|
update : 2015.11.03
php.shukuma.com검색:
|
SNMP::walk(PHP 5 >= 5.4.0) SNMP::walk — Fetch SNMP object subtree 설명
public array SNMP::walk
( string
$object_id
[, bool $suffix_as_key = FALSE
[, int $max_repetitions
[, int $non_repeaters
]]] )
SNMP::walk() is used to read SNMP subtree rooted at specified 인수
반환값
Returns an associative array of the SNMP object ids and their values on success or 오류/예외
This method does not throw any exceptions by default.
To enable throwing an SNMPException exception when some of library errors occur
the SNMP class parameter 예제Example #1 SNMP::walk() example
<?php위 예제의 출력 예시:
Array
(
[SNMPv2-MIB::sysDescr.0] => STRING: Test server
[SNMPv2-MIB::sysObjectID.0] => OID: NET-SNMP-MIB::netSnmpAgentOIDs.8
[DISMAN-EVENT-MIB::sysUpTimeInstance] => Timeticks: (1150681750) 133 days, 4:20:17.50
[SNMPv2-MIB::sysContact.0] => STRING: Nobody
[SNMPv2-MIB::sysName.0] => STRING: server.localdomain
...
)
Example #2
<?php위 예제의 출력 예시:
Array
(
[1] => igb0
[2] => igb1
[3] => ipfw0
[4] => lo0
[5] => lagg0
)
Array
(
[1] => INTEGER: ieee8023adLag(161)
[2] => INTEGER: ieee8023adLag(161)
[3] => INTEGER: ethernetCsmacd(6)
[4] => INTEGER: softwareLoopback(24)
[5] => INTEGER: ethernetCsmacd(6)
)
Array
(
[igb0] => INTEGER: ieee8023adLag(161)
[igb1] => INTEGER: ieee8023adLag(161)
[ipfw0] => INTEGER: ethernetCsmacd(6)
[lo0] => INTEGER: softwareLoopback(24)
[lagg0] => INTEGER: ethernetCsmacd(6)
)
참고
|