simple SNMP client
snmp utility is a simple SNMP
The subcommands are as follows:
get[options] agent oid ...
- Retrieve the varbind for oid from the agent. If more than one oid is specified, retrieve the varbind for each one.
getnext[options] agent oid ...
- Retrieve the varbind that follows oid from the agent. If more than one oid is specified, retrieve the varbind following each one of them.
walk[options] agent [oid]
- Retrieve all the varbinds that are branches of oid
from the agent. This uses the
getnextsubcommand internally and requests a single varbind at a time. If no oid is specified, it defaults to mib-2 (.22.214.171.124.2.1).
bulkget[options] agent oid ...
- Retrieve the next 10 varbinds following each oid
from the agent. This command is not available for
bulkwalk[options] agent [oid]
- Retrieve all the varbinds from the agent that are
branches of oid. This uses the
bulkgetsubcommand internally to retrieve multiple varbinds at a time. This command is not available for
set[options] agent varoid type value ...
- Set one or more varoid to a new value. The format of the varoid type value triple is described in Data types, below.
trap[options] agent uptime trapoid [varoid type value ...]
- Send a trap message to the agent. The
uptime is specified in timeticks (centiseconds) or
defaults to the system uptime if an empty string is given. The
trapoid is the identification OID used by the trap
handler to determine its action. This command is not available for
- An SNMP based version of the df(1) command. If no size suffix is shown, the sizes are in kilobytes.
-OfnS] [oid ...]
- Dump the tree of compiled-in MIB objects. If oid is specified it will print the objects in the requested output format if available, or print a warning if the object can't be found.
The options are as follows:
- The authentication password for the user. This will be transformed to
localauth. This option is only used by
- Set the digest (authentication) protocol. Options are
SHA-512. This option defaults to
SHA. This option is only used by
- For the
walksubcommands, set the application specific appopt options by supplying a string of one or more of the following modifier letters:
bulkwalk, disable checking the order of MIBs. On some devices that return MIBs out of order, this may cause an infinite loop.
walk, walk the tree up to but excluding endoid. The blank before endoid is mandatory.
dfprint the output in “human-readable” format.
walk, do not fall back to returning the original MIB via a
bulkwalk, always do a
getrequest on the specified oid first.
bulkwalk, Set the non-repeaters field in the request to the non-negative integer nonrep. This causes the first nonrep oid arguments to only return a single MIB instead of maxrep. This value defaults to 0. No blank is allowed before nonrep.
bulkwalk, also show a summary of the total variables received.
df, set the max-repetitions field in the request to the positive integer maxrep. This determines the amount of MIBs to return for each specified OID. This value defaults to 10. No blank is allowed before maxrep.
bulkwalkdon't include skipoid or its children in the walk output. The blank before skipoid is mandatory.
walk, Show how long it took to walk the entire tree.
- Set the community string. This option is only used
2cand has no default.
- The USM security engine id. Under normal circumstances this value is
discovered via snmpv3 discovery and does not need to be specified. This
option is only used by
- The snmpv3 context engine id. Most of the time this value can be safely
ignored. This option is only used by
- The localized privacy password for the user in hexadecimal format
(optionally prefixed with a
0x). This option is only used by
- The localized authentication password for the user in hexadecimal format
(optionally prefixed with a
0x). This option is only used by
- The security level. Values can be
-Kin addition to the
authNoPrivrequirements). This option is only used by
- Sets the context name. Defaults to an empty string. This option is only
- Set the output options by supplying a string of one
or more of the following modifier letters:
- Print the varbind string unchanged rather than replacing non-printable bytes with dots.
- When displaying an OID, include the full list of MIB objects. By default only the last textual MIB object is shown.
- Display the OID numerically.
- Remove the type information.
- Remove the type information and the equal sign.
- Display the MIB name and the type information. This is the default behaviour.
- Only display the varbind value, removing the OID.
- Display the varbind string values as hexadecimal strings.
mibtreesubcommand may only use the [
-fnS] output options; no output options are available for
- Set the number of retries in case of packet loss. Defaults to 5.
- Set the timeout to wait for a reply, in seconds. Defaults to 1.
- Sets the username. If
3is used, this option is required. This option is only used by
- Set the snmp protocol version to either
3. Currently defaults to
- The privacy password for the user. This will be transformed to
localpriv. This option is only used by
- Sets the cipher (privacy) protocol. Options are
AES. This option defaults to
AES. This option is only used by
- Set the engine boots and engine time. Under normal circumstances this
value is discovered via snmpv3 discovery and does not need to be
specified. This option is only used by
The syntax for the agent argument is [protocol:]address, with the following format:
||hostname[:port] | IPv4-address[:port]|
The default protocol is
udp and the default port is
161, except for the
trap subcommand, which uses 162.
tcp6. To specify
an IPv6-address without a port, the
IPv6-address must be enclosed in square brackets. If
the square brackets are omitted, the value after the last colon is always
interpreted as a port.
Additional data sent to the server is formatted by specifying one or more triples of varoid, type, and value. Supported types are:
- An IPv4 Address.
- A bitstring. A list of individual bit offsets separated by comma, space or tab. Must be supplied as a single argument.
- A counter32.
- A decimal string. A list of individual bytes in decimal form separated by space or tab.
- An integer.
- A null object.
- An OID.
- A regular string.
- Timeticks in centiseconds.
- Unsigned integer.
- A hex string. Similar to a decimal string, but in hexadecimal format.
- The character encoding locale(1) used for output. It decides whether objects
having a display format of UTF-8 are printed as UTF-8, and whether each
byte invalid according to the object's display format is printed as a
UTF-8 replacement character (‘�’).
If unset or set to "C", "POSIX", or an unsupported value, for objects having a display format of UTF-8, each printable non-ASCII character is replaced with a single dot (‘.’). Each byte invalid according to the object's display format is printed as a question mark (‘?’).
Each non-printable character is always replaced with a single dot (‘.’).
snmp program first appeared in
snmp program was written by
Martijn van Duren