Snmpgetnext

From Net-SNMP Wiki
Revision as of 22:54, 30 June 2011 by Wes (Talk | contribs) (Created page with "{{tool|snmpgetnext|manual=1|tutorial=1|code=apps/snmpgetnext.c}} == Purpose == Issue a single SNMP GETNEXT operation to a remote agent. == Command Line == The command lin...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Net-SNMP Tool
snmpgetnext
Manual: snmpgetnext
Tutorial: Tutorial
Code: apps/snmpgetnext.c

Purpose

Issue a single SNMP GETNEXT operation to a remote agent.

Command Line

The command line options are per the snmpcmd options.

The remaining options are a list of OIDs to issue GETNEXTs for. GETNEXTs always find the next instance of data beyond the requested OID.

Example Usages

This requests the next object below the sysContact MIB node. This will result in returning the an instance of it (in the case of sysContact there is only one instance, the .0 instance):

 # snmpgetnext -v 1 -c demopublic test.net-snmp.org sysContact
 SNMPv2-MIB::sysContact.0 = STRING: Net-SNMP Coders

If we take the resulting OID of what it gave us, we'll get the next one after this:

 # snmpgetnext -v 1 -c demopublic test.net-snmp.org SNMPv2-MIB::sysContact.0
 SNMPv2-MIB::sysName.0 = STRING: test.net-snmp.org

Issuing a whole bunch of GETNEXTs in a row is called "walking" and is exactly what the snmpwalk tool does.