This object is used to send SNMP requests to a remote device.
Initialize
or Initialize2
must be called prior to any other members.
CoreAsp.SnmpRqst uses a three step process:
Initialize
or Initialize2
to initialize the object against a particular device.Get
, GetNext
, GetMultiple
or Set
operations against a device. Those operations return an ComSnmpResponse
object that contains the status of the operation and the value either directly (use Failed/GetValue/GetOid
) or as a list of SNMP variable binding returned as XML data (use GetPayload
).Method |
Description |
Returns |
Initialize( |
Initializes the
Tip: In Active Script Monitor and Script Performance Monitors, the device ID of the device to which the monitor is assigned can be obtained from the Context object: |
ComResult object |
Initialize2( |
Initializes the
|
ComResult object |
SetTimeoutMs( |
Sets the timeout value in milliseconds. If not specified, the timeout defaults to 2000 milliseconds.
|
ComResult object |
SetNumRetries( |
Sets the number of times to retry a request that has timed out. If not specified, failed requests are retried one time.
Tip: To send only one SNMP packet per request, set |
ComResult object |
SetPort( |
Sets the TCP/IP port to be used by
|
ComResult object |
Get( |
Issues an SNMP Get command to retrieve the value of the specified object.
|
ComSnmpResponse object |
GetNext( |
Issues an SNMP GetNext command to retrieve the value of the object that follows the specified object in lexicographic order.
|
ComSnmpResponse object |
GetMultiple( |
Issues an SNMP Get command for each of the objects specified.
|
ComSnmpResponse object |
Set( |
Issues an SNMP Set command to set an OID value on a device.
|
ComSnmpResponse object |
Note: The Set function will not work unless the MIB object and the community string for the device have the Read Write access right.