php8.5
Home/ Manual/ snmp / functions/ snmp3_real_walk

snmp3_real_walk

PHP function Edit on GitHub ✎

(PHP 4, PHP 5, PHP 7, PHP 8)

Return all objects including their respective object ID within the specified one

Description

snmp3_real_walk(string $hostname, string $security_name, string $security_level, string $auth_protocol, string $auth_passphrase, string $privacy_protocol, string $privacy_passphrase, array|string $object_id, int $timeout = -1, int $retries = -1): array|false

The snmp3_real_walk() function is used to traverse over a number of SNMP objects starting from object_id and return not only their values but also their object ids.

Parameters

hostname

The hostname of the SNMP agent (server).

security_name

Security-name

security_level

Security-level

auth_protocol

Auth-protocol

auth_passphrase

Auth-passphrase

privacy_protocol

Privacy-protocol

privacy_passphrase

Privacy-passphrase

object_id

The SNMP object id.

timeout

The number of microseconds until the first timeout.

retries

The number of times to retry if timeouts occur.

Return Values

Returns an associative array of the SNMP object ids and their values on success or false on error. In case of an error, an E_WARNING message is shown.

Changelog

VersionDescription

Examples

Using snmp3_real_walk()

php
<?php
 var_export(snmp3_real_walk('localhost', 'james', 'authPriv', 'SHA', 'secret007', 'AES', 'secret007', 'IF-MIB::ifName'));
?>

The above will output something like: array ( 'IF-MIB::ifName.1' => 'STRING: lo', 'IF-MIB::ifName.2' => 'STRING: eth0', 'IF-MIB::ifName.3' => 'STRING: eth2', 'IF-MIB::ifName.4' => 'STRING: sit0', 'IF-MIB::ifName.5' => 'STRING: sixxs', )

See Also

Source: reference/snmp/functions/snmp3-real-walk.xml · from the official PHP manual (php/doc-en)