snmpcmd - options and behaviour common to most of the Net-SNMP command-line tools |
snmpcmd [OPTIONS] AGENT [PARAMETERS] |
This manual page describes the common options for the SNMP commands: snmpbulkget, snmpbulkwalk, snmpdelta, snmpget, snmpgetnext, snmpnetstat, snmpset, snmpstatus, snmptable, snmptest, snmptrap, snmpdf, snmpusm , snmpwalk . The command line applications use the SNMP protocol to communicate with an SNMP capable network entity, an agent. Individual applications typically (but not necessarily) take additional parameters that are given after the agent specification. These parameters are documented in the manual pages for each application. |
-3[MmKk] 0xHEXKEY |
Sets the keys to be used for SNMPv3 transactions. These options allow you to set the master authentication and encryption keys (-3m and -3M respectively) or set the localized authentication and encryption keys (-3k and -3K respectively). SNMPv3 keys can be either passed in by hand using these flags, or by the use of keys generated from passwords using the -A and -X flags discussed below. For further details on SNMPv3 and its usage of keying information, see the Net-SNMP tutorial web site ( http://www.Net-SNMP.org/tutorial-5/commands/ ). Overrides the defAuthMasterKey (-3m), defPrivMasterKey (-3M), defAuthLocalizedKey (-3k) or defPrivLocalizedKey (-3K) tokens, respectively, in the snmp.conf file, see snmp.conf(5). |
-a authProtocol |
Set the authentication protocol (MD5 or SHA) used for authenticated SNMPv3 messages. Overrides the defAuthType token in the snmp.conf file. |
-A authPassword |
Set the authentication pass phrase used for authenticated SNMPv3 messages. Overrides the defAuthPassphrase token in the snmp.conf file. It is insecure to specify pass phrases on the command line, see snmp.conf(5). |
-c community |
Set the community string for SNMPv1/v2c transactions. Overrides the defCommunity token in the snmp.conf file. |
-d |
Dump (in hexadecimal) the raw SNMP packets sent and received. |
-D TOKEN[,...] |
Turn on debugging output for the given TOKEN(s). Try ALL for extremely verbose output. |
-e engineID |
Set the authoritative (security) engineID used for SNMPv3 REQUEST messages. It is typically not necessary to specify this, as it will usually be discovered automatically. |
-E engineID |
Set the context engineID used for SNMPv3 REQUEST messages scopedPdu. If not specified, this will default to the authoritative engineID. |
-h, --help |
Display a brief usage message and then exit. |
-H |
Display a list of configuration file directives understood by the command and then exit. |
-I [brRhu] |
Specifies input parsing options. See INPUT OPTIONS below. |
-l secLevel |
Set the securityLevel used for SNMPv3 messages (noAuthNoPriv|authNoPriv|authPriv). Appropriate pass phrase(s) must provided when using any level higher than noAuthNoPriv. Overrides the defSecurityLevel token in the snmp.conf file. |
-L [eEfFoOsS] |
Specifies output logging options. See LOGGING OPTIONS below. |
-m MIBLIST |
Specifies a colon separated list of MIB modules (not files) to load for this application. This overrides (or augments) the environment variable MIBS, the snmp.conf directive mibs, and the list of MIBs hardcoded into the Net-SNMP library. |
If MIBLIST has a leading ’-’ or ’+’ character, then the MIB modules listed are loaded in addition to the default list, coming before or after this list respectively. Otherwise, the specified MIBs are loaded instead of this default list. The special keyword ALL is used to load all MIB modules in the MIB directory search list. Every file whose name does not begin with "." will be parsed as if it were a MIB file. |
-M DIRLIST |
Specifies a colon separated list of directories to search for MIBs. This overrides (or augments) the environment variable MIBDIRS, the snmp.conf directive mibdirs, and the default directory hardcoded into the Net-SNMP library (/usr/share/snmp/mibs). |
If DIRLIST has a leading ’-’ or ’+’ character, then the given directories are added to the default list, being searched before or after the directories on this list respectively. Otherwise, the specified directories are searched instead of this default list. Note that the directories appearing later in the list have have precedence over earlier ones. To avoid searching any MIB directories, set the MIBDIRS environment variable to the empty string (""). Note that MIBs specified using the -m option or the mibs configuration directive will be loaded from one of the directories listed by the -M option (or equivalents). The mibfile directive takes a full path to the specified MIB file, so this does not need to be in the MIB directory search list. |
-n contextName |
Set the contextName used for SNMPv3 messages. The default contextName is the empty string "". Overrides the defContext token in the snmp.conf file. |
-O [abeEfnqQsStTuUvxX] |
Specifies output printing options. See OUTPUT OPTIONS below. |
-P [cdeRuwW] |
Specifies MIB parsing options. See MIB PARSING OPTIONS below. |
-r retries |
Specifies the number of retries to be used in the requests. The default is 5. |
-t timeout |
Specifies the timeout in seconds between retries. The default is 1. Floating point numbers can be used to specify fractions of seconds. |
-u secName |
Set the securityName used for authenticated SNMPv3 messages. Overrides the defSecurityName token in the snmp.conf file. |
-v 1 | 2c | 3 |
Specifies the protocol version to use: 1 (RFCs 1155-1157), 2c (RFCs 1901-1908), or 3 (RFCs 2571-2574). The default is typically version 3. Overrides the defVersion token in the snmp.conf file. |
-V, --version |
Display version information for the application and then exit. |
-x privProtocol |
Set the privacy protocol (DES or AES) used for encrypted SNMPv3 messages. Overrides the defPrivType token in the snmp.conf file. This option is only valid if the Net-SNMP software was build to use OpenSSL. |
-X privPassword |
Set the privacy pass phrase used for encrypted SNMPv3 messages. Overrides the defPrivPassphrase token in the snmp.conf file. It is insecure to specify pass phrases on the command line, see snmp.conf(5). |
-Z boots,time |
Set the engineBoots and engineTime used for authenticated SNMPv3 messages. This will initialize the local notion of the agents boots/time with an authenticated value stored in the LCD. It is typically not necessary to specify this option, as these values will usually be discovered automatically. |
-Yname="value" |
--name="value" |
Allows to specify any token ("name") supported in the snmp.conf file and sets its value to "value". Overrides the corresponding token in the snmp.conf file. See snmp.conf(5) for the full list of tokens. |
The string AGENT in the SYNOPSIS above specifies the remote SNMP entity with which to communicate. This specification takes the form: |
[<transport-specifier>:]<transport-address> |
At its simplest, the AGENT specification may consist of a hostname, or an IPv4 address in the standard "dotted quad" notation. In this case, communication will be attempted using UDP/IPv4 to port 161 of the given host. Otherwise, the <transport-address> part of the specification is parsed according to the following table: |
<transport-specifier> |
<transport-address> format |
udp |
hostname[:port] or IPv4-address[:port] |
||
tcp |
hostname[:port] or IPv4-address[:port] |
||
unix |
pathname |
||
ipx |
[network]:node[/port] |
||
aal5pvc or pvc |
[interface.][VPI.]VCI |