UCD-SNMP Tutorial -- snmpgetnext

Note: Much of this tutorial requires ucd-snmp-4.2.2!, so make sure you get it before running the commands found in this tutorial.

Note: A new tutorial for net-snmp 5.0 and above is available as well. The commands is the ucd-snmp specific tutorial will not work as expected if you are using net-snmp and not ucd-snmp.


The snmpgetnext command, which is similar in usage to the snmpget command, is used to retrieve the next oid in the mib tree of data. Instead of returing the data you requested, it returns the next OID in the tree and its value:


You could use the snmpgetnext command to manually walk down the mib tree in the remote host, by always specifying the last OID that you saw on the command line for the next command:


In fact, the snmpwalk command described in the next section, implements exactly this but in one command!

Unlike the snmpget command, the snmpgetnext command does return data for a OID which is too short or is missing the index part of the OID. For instance, if you remember from the last snmpget discussion, if you left off the .0 on the end of the OID you were requesting on a snmpget command, you were issued an error. With snmpgetnext, you're still issued an answer, because you will always get the next value in the tree, regardless of weather or not you specified a valid OID for a variable or not:



Last modified: Mon Mar 25 08:39:39 PST 2002