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
AsyncSnmpGetBulkmethod appends toSNMP_$tag. This tag is associated with the results of an SNMPget-bulkoperation. For example, if you specify the stringGETBULKto the $tag parameter, theAsyncSnmpGetBulkmethod associates the tagSNMP_GETBULKwith the results for this SNMPget-bulkoperation.
- $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-bulkoperation. 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
@oidsthat return a single value. In the previous example, the@oidslist contains two MIB variables:sysDescrandifIndex. Only thesysDescrMIB 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
AsyncSnmpGetBulkmethod 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, andNAMEMIB. 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.