The snmpgetnext CLI application performs GETNEXT requests from an InfoHub SNMP module. The snmpgetnext command retrieves data that lies next to the specified objects in the order specified by the View. A typical syntax of the snmpgetnext command in the SNMP Plugin is:
snmpgetnext [<snmpcmd_common_options>] -v2c -Oa -c <communitystring> [-m <MIBModule(s)>] OID [OID]...
-
snmpcmd_common_options
snmpcmd_common_options are options and agent arguments that are common to most snmp commands. For more information, refer to the man page entry for snmpcmd.
-
-v
Specifies the SNMP protocol version. If you are using the GT.M SNMP Plugin, always specify -v2c to indicate RFCs (1901-1908) as the SNMP protocol version. For more information, refer to the man page entry for snmpcmd.
-
-m
Specifies a colon delimited list of MIB modules. If you are using the GT.M SNMP Plugin, you would specify -m INFOHUB-1-MIB as the InfoHub MIB module. The MIB acts as a dictionary that translates mnemonics, which are typically more user-friendly, into the numeric values used in the SMNP protocol. For more information, refer to the man page entry for snmpcmd.
-
-c
Specifies the community string for SNMP v1/v2c transactions. For more information, refer to the man page entry for snmpcmd.
-
-Oa
Displays strings in ASCII form. For more information on the -O option, refer to the man page entry for snmpcmd.
-
OID
OID is the object identifier of a monitored object in an MIB. If your monitored objects are in the InfoHub MIB module, you need to additional specify one of the four Views and an Object Index. A command like
snmptranslate -m INFOHUB-1-MIB -Tp | less
displays a list of all objects stored in the InfoHub MIB module.
For more information on the snmpgetnext command options, refer to the man page of the snmpgetnext command.
Examples:
With curr View:
$ snmpgetnext -v2c -c <communitystring> -Oa -m INFOHUB-1-MIB localhost INFOHUB-1-MIB::infohubtestMyBoxSyslogDBFILEXTcurr.0
This example retrieves the data value of the object that lies immediately after infohubtestMyBoxSyslogDBFILEXT in the InfoHub MIB module.
With hist View:
$ snmpgetnext -v2c -c <communitystring> -Oa -m INFOHUB-1-MIB localhost INFOHUB-1-MIB::infohubtestMyBoxSyslogDBFILEXThist.1
This example retrieves the predecessor (that is, hist.2) of the hist.1 value of the object infohubtestMyBoxSyslogDBFILEXThist.
With time View:
$ snmpgetnext -v2c -c <communitystring> -Oa -m INFOHUB-1-MIB localhost INFOHUB-1-MIB::infohubtestMyBoxSyslogGTMFataltime.`date --date "10/09/2013 19:05:00" +%s` INFOHUB-1-MIB::infohubtestInfoHubOID = OID: INFOHUB-1-MIB::infohubtestMyBoxSyslogGTMFatalsnum.19
This example retrieves the mnemonic OID and the sequence number of the first fatal GT.M error that was stored on Infohub after 10/09/2013 14:26:00. This View is useful in situations where you need to investigate incidents occurring around a specified time.
With snum View:
$ snmpgetnext -v2c -c <communitystring> -Oa -m INFOHUB-1-MIB localhost INFOHUB-1-MIB::infohubtestMyBoxSyslogGTMFatalsnum.18 INFOHUB-1-MIB::infohubtestMyBoxSyslogGTMFatalsnum.19 = STRING: "Oct 9 19:06:07 gtmnode20 GTM-SRCSRVR-INSTANCE1[14796]: %GTM-F-FORCEDHALT, Image HALTed by MUPIP STOP -- generated from 0x0000000000000000."
This example uses the sequence number (snum.18) returned with the time View example to retrieve the data value of the next GT.M Fatal error stored on InfoHub immediately after sequence number 18. In most cases, you would use the snum View in conjunction with the time View which returns the sequence number of the monitored object's mnemonic OID.
You can also use the snmpbulkget command to display the next 10 data values of objects stored in InfoHub after sequence number 18.
$ snmpbulkget -v2c -c <communitystring> -Oa -m INFOHUB-1-MIB localhost INFOHUB-1-MIB::infohubtestMyBoxSyslogGTMFatalsnum.18
You can also specify -Cr20 to retrieve the next 20 data values of objects stored in InfoHub after sequence number 18.
AIX Notes | |
---|---|
On AIX, you need to explicitly specify the port number for the NET-SNMP Agent since another port was assigned during installation (see the agentAddress line in snmpd.conf). A sample snmpgetnext command might look like: snmpgetnext -v2c -c <communitystring> -Oa -m INFOHUB-1-MIB 127.0.0.1:9716 INFOHUB-1-MIB::infohubtestMyBoxSyslogAllcurr.0 or: snmpgetnext -v2c -c <communitystring> -Oa -m INFOHUB-1-MIB 127.0.0.1:1610 INFOHUB-1-MIB::infohubtestMyBoxSyslogAllcurr.0 |