CoreAsp.ComSnmpResponse

This object contains a response from an SNMP request. It is returned by SnmpRqst member functions: Get, GetNext, GetMultiple and Set.

Member

Description

GetOid

Returns the OID of the polled object. This member cannot be used with operations that poll multiple objects, such as SnmpRqst.GetMultiple.

Note: This member is only useful when used with SnmpRqst.GetNext. It can be used with SnmpRqst.Get and SnmpRqst.Set, but it returns the same OID that you specified when calling those functions.

GetValue

Returns the value of the polled object. This member can only be used with functions that poll a single object (SnmpRqst.Get, SnmpRqst.GetNext and SnmpRqst.Set)

Failed

If the request succeeded, returns false. If the request failed, returns true.

Note: When polling multiple objects, Failed returns true if even one error exists in the results returned by GetPayload.

GetErrorMsg

If Failed returns true, this member returns the associated error message.

GetPayload

Returns XML data describing SNMP variable bindings (each containing OID, Type and Value).

This XML data consists of a single VarBindList node which contains one or many SnmpVarBind nodes.

<VarBindList>
<SnmpVarBind bHasError="false" sError="" sOid="1.3.6.1.2.1.1.1.0" sValue="HELLO" />
<SnmpVarBind bHasError="false" sError="" sOid="1.3.6.1.2.1.1.1.1" sValue="WORLD" />
</VarBindList>

You can use the Microsoft XML DOM object to access this information. For more information, see the Read multiple objects in one request example.

Note: All the members of the ComSnmpResponse object are methods. They have no arguments and should be called without using parenthesis.

See Also

Using the SNMP API

CoreAsp.SnmpRqst

CoreAsp.ComResult

Example scripts using the SNMP API

Troubleshooting the SNMP API