AsyncSnmpGetBulk

The AsyncSnmpGetBulk method performs an asynchronous SNMP get-bulk operation on all MIB objects in the specified MIB table.

Method Synopsis

AsyncSnmpGetBulk($tag, $host, $addOn, 
$oidBindList, $nonRepeaters, $maxRepetitions 
[,$instance [,$splitOutput]])

Parameters

$tag
Specifies a string that the AsyncSnmpGetBulk method appends to SNMP_$tag. This tag is associated with the results of an SNMP get-bulk operation. For example, if you specify the string GETBULK to the $tag parameter, the AsyncSnmpGetBulk method associates the tag SNMP_GETBULK with the results for this SNMP get-bulk operation.
$host
Specifies a valid a host IP address.
$addOn
Specifies the suffix to the community string.
$oidBindList
Specifies a reference to an array that contains the MIB variables for which you want to perform an asynchronous SNMP get-bulk operation. The following is an example of an array that contains two MIB variables:
$oidBindList = \@oids;
where,
@oids = ('sysDescr', 'ifIndex');
$nonRepeaters
Specifies the number of MIB variables at the start of the list of @oids that return a single value. In the previous example, the @oids list contains two MIB variables: sysDescr and ifIndex. Only the sysDescr MIB variable returns a single value. Thus, this parameter would be set to the value 1 for the previous example.
$maxRepetitions
Specifies the number of MIB variable values in the table to be returned. For example, if you specify the value 2 to the $maxRepetitions parameter, the AsyncSnmpGetBulk method returns only the values for the first two MIB variables in the table. To return values for all MIB variables in the table, specify a large number for this parameter.

This parameter is relevant for MIB variables that return a table, for example, ifIndex.

$instance
Specifies the start of the MIB subtree to retrieve. You must specify $instance as an ASN1 string (for example, 5.3.15).

This parameter is optional.

$splitOutput
Specifies a value of true or false. If set to true (1) returns three extra keys — OID, INDEX, and NAMEMIB. The default is false (0), that is, does not return the three extra keys.

This parameter is optional.

Description

The AsyncSnmpGetBulk method performs an asynchronous SNMP get-bulk operation on all MIB objects specified in $oidBindList. The SnmpGetBulk method returns the three extra keys — OID, INDEX, and NAMEMIB — only if the $splitOutput parameter is set to true (1).

Notes

The parameters $nonRepeaters and $maxRepetitions must be defined. No default values are specified for these parameters.

Example Usage

my @oids=
('sysDescr', 'sysContact', 'sysUpTime', 'ipInReceives',
'ipOutRequests', 'ipOutDiscards', 'ipForwDatagrams', 'tcpCurrEstab',
'ifDescr');

$snmp->AsyncSnmpGetBulk("GETBULK", "1.2.3.4", "", \@oids, 8, 100);

($tag, $data) = RIV::GetInput(-1);

Returns

Upon completion, the AsyncSnmpGetBulk method returns a reference to an array of varops and the tag SNMP_$tag. If the request failed, AsyncSnmpGetBulk returns undef. The return value, along with the tag SNMP_$tag, are returned in a call to RIV::GetInput.

See Also