SNMP Manager Programmer's Guide

Programming Examples
SNMP Manager Programmer’s Guide–134249
2-66
SNMPNEXT
subagent so that it communicates with $ZSNMP1, the object retrieved is the expected
object.
The only difference between the main block for SNMPGET and that for SNMPNEXT
(located in snmpnxtc) is that the SNMP_Create_Request() call in the main block of
SNMPNEXT creates a GetNext packet instead of a Get packet:
send_pkt = SNMP_Create_Request(GET_NEXT_REQUEST_PDU, VERSION_RFC1067,
strlen(community), community, (INT_32_T)requestid, oidcnt);
Example 2-7. Sample SNMPNEXT Output
TACL> SNMPNEXT -a $zsnmp1 \mynode 1.3.6.1.2.1.25.2.0
------ RUNNING LOCAL ------
SENDING PACKET:
Packet Length=65, Version=0, Community: Length=6, Value=public
PDU Type=get-next-request Length=65, RQ_ID=1, Err_stat=noError, Err_ndx=0
VBLlen=39, VBcount=1
VarBind #0, content size=39, Flags & type=0x05, encoded length=5
OBJECT IDENTIFIER: mib-2.25.2.0
NULL
RECEIVED PACKET:
Packet Length=99, Version=0, Community: Length=0, Value=
PDU Type=get-response Length=99, RQ_ID=1, Err_stat=noError, Err_ndx=0
VBLlen=89, VBcount=1
VarBind #0, content size=84, Flags & type=0x04, encoded length=25
OBJECT IDENTIFIER: 1.3.6.1.4.1.169.3.155.1.7.1.1.0
OCTET STRING: Length=25
JAN 9, 1996 16:17:40.182
TACL> RUN HMSAX /NAME $zhrm,nowait/ -a $zsnmp1
TACL> SNMPNEXT -a $zsnmp1 \mynode 1.3.6.1.2.1.25.2.0
------ RUNNING LOCAL ------
SENDING PACKET:
Packet Length=65, Version=0, Community: Length=6, Value=public
PDU Type=get-next-request Length=65, RQ_ID=1, Err_stat=noError, Err_ndx=0
VBLlen=39, VBcount=1
VarBind #0, content size=39, Flags & type=0x05, encoded length=5
OBJECT IDENTIFIER: mib-2.25.2.0
NULL
RECEIVED PACKET:
Packet Length=60, Version=0, Community: Length=0, Value=
PDU Type=get-response Length=60, RQ_ID=8, Err_stat=noError, Err_ndx=0
VBLlen=50, VBcount=1
VarBind #0, content size=47, Flags & type=0x02, encoded length=4
OBJECT IDENTIFIER: mib-2.25.2.2.0
INTEGER: 2359104