snmp2_walk
snmp2_walk
Fetch all the SNMP objects from an agent
**snmp2_walk** string $hostname string $community $object_id int $timeout int $retries
function is used to read all the values from
an agent specified by the .
snmp2_walk``hostname
hostnameThe SNMP agent (server).
communityThe read community.
object_id
If null, is taken as the root of
the objects tree and all objects under that tree are returned as
an array.
object_id
If is specified, all the objects
below that are returned.
`object_id``object_id`
timeoutThe number of microseconds until the first timeout.
retriesThe number of times to retry if timeouts occur.
Returns an array of object values starting from the
as root or false on error.
object_id
Voorbeeld: Example
<?php
$a = snmp2_walk("127.0.0.1", "public", "");
foreach ($a as $val) {
echo "$val\n";
}
?>
Above function call would return all the objects from the agent running on localhost. One can step through the values with a loop
snmp2_real_walk