SNMP Manager Programmer's Guide
Programming Examples
SNMP Manager Programmer’s Guide–134249
2-56
SNMPGET
MIB-object
identifies a MIB object instance. If the object is a MIB-II object, you can refer to it
by name or using the dotted OID format; use the dotted OID format for objects that
are not MIB-II objects:
sysContact.0
1.3.6.1.2.1.25.2.2.0
You can specify as many as 16 MIB objects.
Example 2-5
illustrates the output SNMPGET generates.
Example 2-6 illustrates the contents of snmpgetc, the source code file for the main block
of SNMPGT. Figure 2-2, shown earlier, illustrates the logic flow of this manager.
Numbers in Example 2-6 correspond to numbers in the observations made between here
and the example.
1. The same header files included by SNMPGT are included. Two additional header
files are required by SNMPGET: tal.h and snmpfs.h. The former is needed for
NonStop Kernel system call condition code definitions. The latter contains
definitions needed by snmpfsc. Both snmpfs.h and snmpfsc are described in
Managers Supporting UDP and IPC
on page 2-6.
2. When the invocation line arguments preceded with a minus sign are parsed, any
NonStop process name specified is saved in snmpagt.
3. SNMP_Init_(), defined in snmpfsc, accepts a pointer to SNMP_HOST_INT_T
(defined in snmpfs.h), the size of this structure, and the target host identifier. It
returns 1 for IPC communication or 0 for UDP communication.
Example 2-5. Sample SNMPGET Output
TACL> SNMPGET -a $zsnmp1 \mynode sysDescr.0
------ RUNNING LOCAL ------
SENDING PACKET:
Packet Length=69, Version=0, Community: Length=6, Value=public
PDU Type=get-request Length=69, RQ_ID=1, Err_stat=noError, Err_ndx=0
VBLlen=43, VBcount=1
VarBind #0, content size=43, Flags & type=0x05, encoded length=5
OBJECT IDENTIFIER: sysDescr.0
NULL
RECEIVED PACKET:
Packet Length=122, Version=0, Community: Length=0, Value=
PDU Type=get-response Length=122, RQ_ID=1, Err_stat=noError, Err_ndx=0
VBLlen=112, VBcount=1
VarBind #0, content size=107, Flags & type=0x04, encoded length=72
OBJECT IDENTIFIER: sysDescr.0
OCTET STRING: Length=72
Tandem NonStop Kernel System Version: D30 Node: \MYNODE Agent: $ZSNMP1