Remember that the timeout includes trip time for transport, so setting it too low and sending it across the country will time out and return a 'No response from x.x.x.x'(PHP >= 5.2.0, PHP 7, PHP 8)
snmp2_real_walk — Devuelve todos los objetos incluyendo los identificadores de sus respectivos objetos
$hostname,$community,$object_id,$timeout = -1,$retries = -1
La función snmp2_real_walk() se utiliza para
recorrer un número de objetos SNMP comenzando por
el objeto identificado por object_id y devuelve
no solo sus valores, sino también los identificadores de sus objetos.
hostnamecommunityobject_idtimeoutretries
Devuelve un array asociativo de identificadores de objetos
SNMP así como sus valores en caso de éxito
o false si ocurre un error.
En caso de error, se emitirá una alerta de tipo
E_WARNING.
Ejemplo #1 Ejemplo con snmp2_real_walk()
<?php
print_r(snmp2_real_walk("localhost", "public", "IF-MIB::ifName"));
?>El ejemplo anterior mostrará algo como:
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
)
Remember that the timeout includes trip time for transport, so setting it too low and sending it across the country will time out and return a 'No response from x.x.x.x'