SNMPCMD (1)
commmands to communicate with a network entity using SNMP Requests.
SYNOPSIS
snmpcmd
[-h|-H|-V]
[-v (1 | 2c | 3) ]
[-O <OUTOPTS> ] [-I <INOPTS> ]
[-P <PARSEROPTS> ]
[-m mibs] [-M mibdirs]
[-d] [-D <TOKEN[,TOKEN,...]> ]
[-r retries] [-t timeout] [-p port] [-T UDP|TCP]
[-c community]
[-e engineid] [-Z boots time] [-n contextname]
[-l seclevel] [-u secname]
[-a authproto] [-A authpasswd] [-x privproto] [-X privpasswd]
agent [community | noauth]
commandparams
DESCRIPTION
This manual page describes the common part of the parameters for
the SNMP commands:
snmpbulkget ,
snmpbulkwalk ,
snmpdelta ,
snmpget ,
snmpgetnext ,
snmpset ,
snmpstatus ,
snmptable ,
snmptest ,
snmptrap ,
snmpusm ,
snmpwalk .
The command line applications use the SNMP protocol to communicate
with an SNMP capable network entity, an agent.
The applications may provide additional
commandparams
that are specified after the
agent
and authentication controls specified here.
prints the applications help message
display the configuration file directives understood be the command
prints the applications version string
specifies the protocol version to use: 1 (RFC 1155-1157), 2c (RFC 1901-1908),
or 3 (RFC 2571-2574)
The default is -v 1
specifies MIB parsing options. See MIB PARSING OPTIONS below.
specifies output printing options. See OUTPUT OPTIONS below.
specifies input parsing options. See INPUT OPTIONS below.
specifies a colon separated list of MIB modules to load for this application.
This overrides the environment variable MIBS.
The special keyword "all" is used to specify all modules in all directories
when searching for MIB files.
Every file whose name does not begin with "."
will be parsed as if it were a MIB file.
specifies a colon separated list of directories to search for MIBs.
This overrides the environment variable MIBDIRS.
request the application to dump all SNMP packets sent and received
request debugging output. The comma separated TOKENs list
specifies what type of debugging information you which to view. Only
debugging information about those TOKEN types will be shown to you.
Only the beginning of the token needs to match. In other words,
specifying
-DmibII
will print debugging output for debugging symbols
mibII
as well as
mibII/system.
The special keyword "all" will display all debugging
output.
The special keyword "trace" will display source code tracing output.
specifies the number of retries to be used in the requests. The default
is 5
specifies the timeout between retries. The default is 1
specifies the port to communicate with at the agent. The default is 161,
except for snmptrap, which defaults to 162.
specifies the transport type to use. By default, UDP is used unless
TCP is specified here.
sets the authoritative(security) engineID used for SNMP v3 Request messages.
This is the engineID of the agent or proxy (e.g., 800000020109840301). (will
be discovered if not supplied)
sets the context engineID used for SNMP v3 Request messages scopedPdu.
This is the engineID of the agent (e.g., 800000020109840301). (will be
authoritative engineID if not specified)
sets the engineBoots and engineTime used for authenticated SNMP v3 messages.
This will initialize the local notion of the agents boots/time with an
authenticated value stored in the LCD. (will be discovered if not supplied)
sets the destination contextName used for SNMP v3 messages. Default
contextName is and empty string ""
sets the securityLevel used for SNMP v3 messages
(noAuthNoPriv|authNoPriv|authPriv). Appropriate pass phrase(s) must provided
when using any level higher than noAuthNoPriv.
sets the securityName used for authenticated SNMP v3 messages
sets the authentication protocol used for authenticated SNMP v3 messages.
(MD5|SHA)
sets the authentication pass phrase used for authenticated SNMP v3 messages
sets the privacy protocol used for encrypted SNMP v3 messages.
(DES)
sets the privacy pass phrase used for encrypted SNMP v3 messages
The
agent
specification may be either a host name or an internet address
specified in "dot notation".
The version 1, or version 2c,
community
specifies the community name for the transaction with the remote system.
MIB PARSING OPTIONS
The UCD parser mostly adheres to
the Structure of Management Information (SMI).
As that specification has changed through time,
and in recognition of the
diversity in compliance expressed in MIB files,
additional options provide more flexibility in reading MIB files.
Show some warning messages in resolving the MIB files.
Can be also set with the configuration token "mibWarningLevel".
Show additional warning messages.
Can be also set with the configuration token "mibWarningLevel".
Don't show MIB errors.
Can be also set with the configuration token "showMibErrors".
Allow ASN.1 comment to extend to the end of the MIB source line.
This overcomes some problems with manually maintained MIB files.
Can be also set with the configuration token "strictCommentTerm".
Collect the DESCRIPTION information into the parsed hierarchy.
This increases the memory used by the size of each DESCRIPTION clause.
Allow underline characters in symbols.
Can be also set with the configuration token "mibAllowUnderline".
Replace MIB objects using the last read MIB file.
WARNING: Setting this option may result in an incorrect hierarchy.
Can be also set with the configuration token "mibReplaceWithLatest".
OUTPUT OPTIONS
Output display can be controlled by passing various parameters to the
-O flag. The following examples should demonstrate this.
The default output looks as follows:
snmpget -c public localhost system.sysUpTime.0
system.sysUpTime.0 = Timeticks: (14096763) 1 day, 15:09:27.63
removes the equal sign and type information,
system.sysUpTime.0 1:15:09:27.63
gives you the complete OID
\.iso.org.dod.internet.mgmt.mib-2.system.sysUpTime.0 = Timeticks: (14096763) 1 day, 15:09:27.63
deletes all by the last symbolic part of the OID
sysUpTime.0 = Timeticks: (14096763) 1 day, 15:09:27.63
is a variant of this, adding the name of the MIB that defined this
object
SNMPv2-MIB::sysUpTime.0 = Timeticks: (14096763) 1 day, 15:09:27.63
prints the OID numerically
snmpget -On -c public localhost system.sysUpTime.0
\.1.3.6.1.2.1.1.3.0 = Timeticks: (14096763) 1 day, 15:09:27.63
removes the symbolic labels from enumerations:
snmpget -c public localhost ip.ipForwarding.0
ip.ipForwarding.0 = forwarding(1)
snmpget -c public -Oe localhost ip.ipForwarding.0
ip.ipForwarding.0 = 1
When OIDs contain a index to a table,
they are broken into the displayable pieces and shown to you. For
example the oid vacmSecurityModel.0.3.119.101.115 is nicely broken
down by default and the string hidden in the oid is shown to you as
vacmSecurityModel.0."wes".
The -Ob option diables this feature and displays it as
vacmSecurityModel.0.3.119.101.115 again.
Note that most of these options can be turned on or off by default by
tuning the snmp.conf file. See the snmp.conf(5) manual page for
details.
INPUT OPTIONS
The -I flag specifies various options that control how your input to
the program is parsed. By default, all input parsing methods are
used: First the oid is parsed regularly, then -IR is used, then -Ib
is used, unless one of the following flags is specified which will
force it to only use one method.
The -IR flag specifies random access lookup, so that if the entire OID
path is not specified, it will search for a node in the mib tree with
your name. Normally, you'd have to specify the vacmSecurityModel oid
above as
but the use of the -IR flag allows you to shorten that to just
vacmSecurityModel.0."wes".
Additionally, see the RANDOM ACCESS MIBS section below.
The -Ib flag indicates that the expression you gave it is actually a
regular expression that should be used to search for the best match
possible in the mib tree. This would allow you to specify the node
vacmSecurityModel MIB node as something as generic as
vacmsecuritymodel (since case insensitive searches are done) or
vacm.*model. Note that multiple matches are obviously possible (.*
matches everything), and the best result is currently calculated as
the one that matches the closest to the beginning of the node name and
the highest in the tree. A current side effect of this option is that
you can't specify indexes or multiple nodes, since the '.' is treated
as part of the regular expression.
RANDOM ACCESS MIBS
Normally, an object identifier such as system.sysDescr.0 will be
lookup in a single "wellknown" place, built into the SNMP library (or
specified by the PREFIX environment variable). The standard place is:
-2. The identifier may alternatively be
a complete object identifier, this is designated by a leading "dot".
To simplify the specification of object identifiers the library
supports random access to the identifiers in the MIBs. This is
requested by the -IR option to the SNMP applications. Additionally,
-Os prints oids in this manner. Using this, system.sysDescr.0 may
also be entered as sysDescr.0. To search only a single MIB for the
identifier (if it appears in more than one), specify it as
SNMPv2-MIB::sysDescr.0. (use -OS to print output oids in this
manner). This notation will also make sure that the specified MIB is
loaded, i.e. it need not be mentioned in the -m option (or MIBS
environment variable).
ENVIRONMENT VARIABLES
The standard prefix for object identifiers. Defaults to .iso.org.dod.internet.mgmt.mib-2
The list of MIBs to load. Defaults to
SNMPv2-TC:SNMPv2-MIB:IF-MIB:IP-MIB:TCP-MIB:UDP-MIB:SNMP-VACM-MIB.
Overridden by the -m option
The list of directories to search for MIBs. Defaults to PREFIX/share/snmp/mibs.
Overridden by the -M option
If this variable is set, the applications acts as if the -s option is specified.
FILES
Agent configuration file. See snmpd.conf(5)
Application configuration files. See snmp.conf(5)
SEE ALSO
|
|