snmpwalk

Retrieve a subtree of management values

snmpwalk [application options] [common options] [oid]

As with all the documentation on this website, this is tersified and you should get clarifation from the man page

Query a network entity using SNMP GETNEXTM.

An object identifier (OID) specifies the portion of the object identifier space to be searched.
All variables in the subtree below the given OID are queried and their values displayed.

If no OID argument is present, a search of the subtree rooted at SNMPv2-SMI::mib-2 (including any MIB object values from other MIB modules, that are within that subtree).

Options

-CE [OID] End the walk at OID.
Used to walk a partial subtree, selected columns of a table, or multiple tables.
-C Include the OID in the search range and output.
By default requests start with OID and returns all results in the MIB subtree rooted at that OID.
-CI the OID will be retrieved if the main subtree walk returns no useable values.
Inhibit the final GET, a walk of a single instance returns nothing.
-Cp Upon completion print the number of variables found.
-Ct Upon completion print the total wall time (in seconds).
Excluding library initialization, shutdown, argument processing and other overhead.
-Cc Do not check if the OIDs are increasing.
Some agents (LaserJets are an example) return OIDs out of order or can cause snmpwalk to loop!

Also accepts the common options described in snmpcmd

examples

Retrieve all of the variables under system:
 snmpwalk -Os -c public -v 1 zeus system

 sysDescr.0 = STRING: "SunOS zeus.net.cmu.edu 4.1.3_U1 1 sun4m"
 sysObjectID.0 = OID: enterprises.hp.nm.hpsystem.10.1.1
 sysUpTime.0 = Timeticks: (155274552) 17 days, 23:19:05
 sysContact.0 = STRING: ""
 sysName.0 = STRING: "zeus.net.cmu.edu"
 sysLocation.0 = STRING: ""
 sysServices.0 = INTEGER: 72
       (plus the contents of the sysORTable).
Retrieve scalars omiting sysORTable.
 snmpwalk -Os -c public -v 1 -CE sysORTable zeus system 
SEE snmpcmd(1), snmpbulkwalk(1), variables(5).
 USAGE: snmpwalk [OPTIONS] AGENT [OID]

  Version:  5.6
  Web:      www.net-snmp.org

net-snmp-coders@lists.sourceforge.net

OPTIONS:
  -H            display configuration file directives understood
  -v 1|2c|3     specifies SNMP version to use
  -V, --version     display package version number SNMP Version 1 or 2c specific
  -c COMMUNITY      set the community string     (public) SNMP Version 3 specific

  -a PROTOCOL       set authentication protocol (MD5|SHA)
  -A PASSPHRASE     set authentication protocol pass phrase
  -e ENGINE-ID      set security engine ID (e.g. 800000020109840301)
  -E ENGINE-ID      set context  engine ID (e.g. 800000020109840301)
  -l LEVEL          set security level (noAuthNoPriv|authNoPriv|authPriv)
  -u USER-NAME      set security name (e.g. bert)
  -n CONTEXT        set context name (e.g. bridge1)
  -x PROTOCOL       set privacy protocol (DES|AES)
  -X PASSPHRASE     set privacy protocol pass phrase

  -Z BOOTS,TIME     set destination engine boots/time

General communication options
  -r RETRIES        set the number of retries
  -t TIMEOUT        set the request timeout (in seconds)
Debugging
  -d            dump input/output packets in hexadecimal
  -D[TOKEN[,...]]   turn on debugging output for the specified TOKENs
               (ALL gives extremely verbose debugging output)
General options

  -m MIB[:...]      load given list of MIBs (ALL loads everything)
  -M DIR[:...]      look in given list of directories for MIBs
    (default: /Users/uusseerr/.snmp/mibs:/usr/share/snmp/mibs)
  -P MIBOPTS        Toggle various defaults controlling MIB parsing:
     u:  allow the use of underlines in MIB symbols
     c:  disallow the use of "--" to terminate comments

     d:  save the DESCRIPTIONs of the MIB objects

     e:  disable errors when MIB symbols conflict
     w:  enable warnings when MIB symbols conflict
     W:  enable detailed warnings when MIB symbols conflict
     R:  replace MIB symbols from latest module

  -O OUTOPTS        Toggle various defaults controlling output display:
     0:  print leading 0 for single-digit hex characters
     a:  print all strings in ascii format
     e:  print enums numerically
     E:  escape quotes in string indices
     b:  do not break OID indexes down
     f:  print full OIDs on output
     n:  print OIDs numerically
     q:  quick print for easier parsing
     Q:  quick print with equal-signs
     s:  print only last symbolic element of OID
     S:  print MIB module-id plus last element
     t:  print timeticks unparsed as numeric integers
     T:  print human-readable text along with hex strings
     u:  print OIDs using UCD-style prefix suppression
     U:  don't print units
     v:  print values only (not OID = value)
     x:  print all strings in hex format
     X:  extended index format

  -I INOPTS     Toggle various defaults controlling input parsing:
     b:  do best/regex matching to find a MIB node
     h:  don't apply DISPLAY-HINTs
     r:  do not check values for range/type legality
     R:  do random access to OID labels
     u:  top-level OIDs must have '.' prefix (UCD-style)
     s SUFFIX:  Append all textual OIDs with 
                        SUFFIX before parsing
     S PREFIX:  Prepend all textual OIDs with 
                        PREFIX before parsing

  -L LOGOPTS        Toggle various defaults controlling logging:
     e:           log to standard error
     o:           log to standard output
     n:           don't log at all
     f file:      log to the specified file
     s facility:  log to syslog (via the specified facility)

     (variants)
     [EON] pri:   log to standard error, output or /dev/null 
     for level 'pri' and above
     [EON] p1-p2: log to standard error, output or /dev/null
                            for levels 'p1' to 'p2'
     [FS] pri token:    log to file/syslog 
                            for level 'pri' and above
     [FS] p1-p2 token:  log to file/syslog 
                            for levels 'p1' to 'p2'
  -C APPOPTS  Set application specific behaviours:
     p:  print the number of variables found
     i:  include given OID in the search range
     I:  don't include the given OID, 
                    even if no results are returned
     c:  do not check returned OIDs are increasing
     t:  Display wall-clock time to complete the request
     E {OID}:  End the walk at the specified OID

 -h, --help  display this help message 

variables

Format of variable names

The syntax and semantics of management information in SNMP is given by the definitions of MIB objects, loaded from one or more MIB files (or "MIB modules"). Not strictly required for the SNMP protocol, but are typically needed by SNMP client applications to display information in a meaningful manner.

The MIB file serves as a design document when developing an SNMP agent providing information and helps coordinate client and server understanding about what management information represents.

OIDs

MIB objects are specified using Object Identifiers (OIDs).
These examples refer to the same object.

Numeric OIDs

A sequence of integers separated by dots (.):
.1.3.6.1.2.1.1.1
This format is used within the SNMP protocol. It does not require MIB files or MIB object definitions.
It relies on the client application and/or network administrator knowing what a given numeric OID refers to.
This format is obtained with -On to most Net-SNMP commands.

Full OID path

Uses subidentifier's name from MIB file(s).
.iso.org.dod.internet.mgmt.mib-2.system.sysDescr
This uniquely identifies an MIB object with the list giving an indication what information this object represents. It relies on MIB files .
This format is obtained with -Of to most Net-SNMP commands.

Combining the name and numeric subidentifier

.iso(1).org(3).dod(6).internet(1).mgmt(2).mib-2(1).system(1).sysDescr(1)

Module-qualified OIDs

Uniquely specifing an OID giving the MIB module name and the name of the MIB object:
SNMPv2-MIB::sysDescr
MIB object names are (usually) unique within a given module, making it easier to find the definition of the MIB object.
This is the default format for displaying OIDs in Net-SNMP applications.
Specified by using -OS.

Object name

The name of the object alone (without the full path) or the name of the module that defines it.
sysDescr The problem occurs if two MIB modules define a MIB object with the same name . It is nor clear which MIB object is intended.

This format can be obtained with -Os.

UCD-format

Version UCD v4.x and earlier used a simple approach to shortening the way OIDs were specified. If the full path of the OID began with .iso.org.dod.internet.mgmt.mib-2 prefix was removed from the OID before displaying it.

If an OID was passed to the UCD library that did not begin with a dot (and wasn't in the module::name format), then the same prefix was prepended. The example OID from the formats listed above would therefore be given or displayed as
system.sysDescr
The inconsistent handling of OIDs, depending on their location within the OID tree, this format is no longer recommended.

The previous behaviour can be obtained by giving -Ou (for displaying output), or -Iu (for interpreting input OIDs without a leading dot) to most Net-SNMP commands.

If the network entity has an error processing the request packet, an error packet will be returned.