|
GetVarAt
snmpvar
GetVarAt(snmppdu
pdu, int index)
Return
Value
Returns SNMP variable binding from
PDU.
Parameters
pdu
–the SNMP
PDU.
index
–zero-based
index that indicates the position of the variable in PDU
Remarks
Call this
function to get SNMP variable at specified position from SNMP
PDU.
Example
snmpvar
var1 = CreateVar("1.3.6.1.2.1.1.1.0")
snmpvar
var2 = CreateVar("1.3.6.1.2.1.1.2.0")
snmppdu
pdu = CreatePdu(var1, var2),
response
int
iVarCount
int
iIndex
snmpvar
var_tmp
response = SnmpGet("65.35.64.170", "public", 2, 3000,
pdu)
iVarCount = GetVarCount(response)
for
(iIndex=0; iIndex <
iVarCount; iIndex++)
var_tmp =
GetVarAt(response,
iIndex)
Println("OID:
", GetVarOID(var_tmp))
Println("VALUE:
",GetVarValue(var_tmp))
endfor
Output of the example script will look
like:
OID: 1.3.6.1.2.1.1.1.0
VALUE: Test
OID: 1.3.6.1.2.1.1.2.0
VALUE: 1.3.6.1.4.1.311.1.1.3.1.1
|