The SnmpGetNext class gets the next value from a remote agent.
Constructor
var request = new SnmpGetNext( context ); context is an object of type SnmpContext.
Properties
Name | Type | Description |
retries | int | The number of retries before failure |
timeout | int | The timeout in seconds before a particular 'getnext' attempt is assumed to have failed |
Methods
Return Value | Name | Description |
void | addOid( String oid ) | Adds an OID to the GETNEXT Request. |
void | destroy() | Frees any resources used by this GETNEXT request. |
String | getInstance( String oid ) | Returns the oid from the results of this GETNEXT request. |
String | getValue( String oid ) | Returns the oid:named value from this result (if sendRequest was successful). |
boolean | isDestroyed() | Returns true if this request has been destroyed. |
boolean | sendRequest() | Performs the GETNEXT operation, returning true if successful. |
Sample usage
var request = new SnmpGetNext( context ); var oid = “1.2.3.6.1.2.1.1.1”; request.addOid( oid ); if ( request.sendRequest() ) { var value = request.getValue( oid );