SNMPWALK(1)
π SNMPWALK β bestie's guide to walking an SNMP subtree π
okay so this is the snmpwalk page from Net-SNMP and I'm gonna be so real with you, it's a whole vibe. it grabs a subtree of management values using SNMP GETNEXT requests. let's get into it π¦
β¨ NAME β¨
snmpwalk β retrieve a subtree of management values using SNMP GETNEXT requests π«Ά
πΈ SYNOPSIS πΈ
snmpwalk [APPLICATION OPTIONS] [COMMON OPTIONS] AGENT [OID]
π DESCRIPTION π
okay so snmpwalk is an SNMP application that uses SNMP GETNEXT requests to query a network entity for a tree of information. it's giving "give me everything under here" energy π
you can hand it an object identifier (OID) right there on the command line. that OID says which portion of the object identifier space is gonna get searched with GETNEXT requests. every variable in the subtree below that OID gets queried and its value gets presented to you. each variable name shows up in the format specified in variables(5). periodt.
if you don't pass an OID argument at all, snmpwalk searches the subtree rooted at SNMPv2-SMI::mib-2 (and yes, that includes any MIB object values from other MIB modules that are defined as lying within this subtree). and if the network entity has an error processing the request packet, an error packet gets returned and a message shows up to help pinpoint why the request was malformed. so helpful honestly π
and if the tree search causes attempts to search beyond the end of the MIB, the message "End of MIB" gets displayed. that's it, that's the whole thing.
π OPTIONS π
-Ccβ do NOT check whether the returned OIDs are increasing. some agents (LaserJets are the example, iconic) return OIDs out of order but can still complete the walk anyway. other agents return OIDs out of order and can causesnmpwalkto loop indefinitely π. by default,snmpwalktries to detect this behavior and warns you when it hits an agent acting illegally. use-Ccto turn off this check.-CE {OID}β end the walk at the specified OID, rather than a simple subtree. this can be used to walk a partial subtree, selected columns of a table, or even two or more tables within a single command. versatile queen β¨-Ciβ include the given OID in the search range. normallysnmpwalkuses GETNEXT requests starting with the OID you specified and returns all results in the MIB subtree rooted at that OID. sometimes you may wish to include the OID specified on the command line in the printed results if it is a valid OID in the tree itself. this option lets you do this explicitly. no guessing required π-CIβ in fact, the given OID will be retrieved automatically if the main subtree walk returns no useable values. this allows a walk of a single instance to behave as generally expected, and return the specified instance value. this option turns off this final GET request, so a walk of a single instance will return nothing. lowkey brutal but okay.-Cpβ upon completion of the walk, print the number of variables found. counting is self-care π-Ctβ upon completion of the walk, print the total wall-clock time it took to collect the data (in seconds). note that the timer is started just before the beginning of the data request series and stopped just after it finishes. most importantly, this means that it does not include snmp library initialization, shutdown, argument processing, and any other overhead. so it's just the walk itself, bestie β±οΈ
in addition to these options, snmpwalk takes the common options described in the snmpcmd(1) manual page. go read that one too, iykyk.
π EXAMPLES π
note that snmpwalk REQUIRES an argument specifying the agent to query and at most one OID argument, as described there. the command:
snmpwalk -Os -c public -v 1 zeus system
will retrieve all of the variables under 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).
and the command:
snmpwalk -Os -c public -v 1 -CE sysORTable zeus system
will retrieve the scalar values, but omit the sysORTable. so if you're like "bestie i do not need the sysORTable today," you know what to do π§
π₯ SEE ALSO π₯
snmpcmd(1), snmpbulkwalk(1), variables(5).
and that's the whole page, bestie!! this one's from Net-SNMP, version V5.9.5.2, dated 28 May 2007 β yeah she's a little vintage but she still ate π
π¦ where this page comes from
- alpine 3.23: net-snmp-doc 5.9.5.2-r0 Β· Net-SNMP
- alpine 3.24: net-snmp-doc 5.9.5.2-r0 Β· Net-SNMP
- arch rolling: net-snmp 5.9.5.2-2 Β· BSD
- fedora 44: net-snmp-utils 1:5.9.5.2-4.fc44 Β· MIT-CMU AND BSD-3-Clause AND MIT
- nixos 26.05: net-snmp 5.9.5.2
- nixpkgs unstable: net-snmp 5.9.5.2
- ubuntu stonking: snmp 5.9.5.2+dfsg-2.1ubuntu5
- Copyright 1988, 1989 by Carnegie Mellon University
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms