#!/usr/bin/php
<?php
$host='host';
$community='community';
$oid='1.3.6.1.2.1.1'; //system
for ($i=0; $i<2; $i++) {
print "snmp_set_oid_output_format: $i\n";
snmp_set_oid_output_format($i);
print_r(snmpwalkoid($host,$community,$oid));
}
print "\n";
?>
snmp_set_oid_output_format: 0
Array
(
[.iso.org.dod.internet.mgmt.mib-2.system.sysDescr.0] => "Cisco Internetwork Operating System Software
IOS (tm) RSP Software (RSP-PV-M), Version 12.3(22), RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2007 by cisco Systems, Inc.
Compiled Wed 24-Jan-07 23:56 by"
[.iso.org.dod.internet.mgmt.mib-2.system.sysObjectID.0] => .iso.org.dod.internet.private.enterprises.9.1.46
[.iso.org.dod.internet.mgmt.mib-2.system.sysUpTime.sysUpTimeInstance] => 1471614725
[.iso.org.dod.internet.mgmt.mib-2.system.sysContact.0] => "contact"
[.iso.org.dod.internet.mgmt.mib-2.system.sysName.0] => "host"
[.iso.org.dod.internet.mgmt.mib-2.system.sysLocation.0] => "local"
[.iso.org.dod.internet.mgmt.mib-2.system.sysServices.0] => 6
[.iso.org.dod.internet.mgmt.mib-2.system.sysORLastChange.0] => 0
)
snmp_set_oid_output_format: 1
Array
(
[.1.3.6.1.2.1.1.1.0] => "Cisco Internetwork Operating System Software
IOS (tm) RSP Software (RSP-PV-M), Version 12.3(22), RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2007 by cisco Systems, Inc.
Compiled Wed 24-Jan-07 23:56 by"
[.1.3.6.1.2.1.1.2.0] => .1.3.6.1.4.1.9.1.46
[.1.3.6.1.2.1.1.3.0] => 1471614730
[.1.3.6.1.2.1.1.4.0] => "contact"
[.1.3.6.1.2.1.1.5.0] => "host"
[.1.3.6.1.2.1.1.6.0] => "local"
[.1.3.6.1.2.1.1.7.0] => 6
[.1.3.6.1.2.1.1.8.0] => 0
)
snmp_set_oid_output_format
(PHP 5 >= 5.2.0)
snmp_set_oid_output_format — Set the OID output format
Description
void snmp_set_oid_output_format
( int $oid_format
)
snmp_set_oid_output_format() sets the output format to be full or numeric.
Parameters
- oid_format
-
Set it to SNMP_OID_OUTPUT_FULL if you want a full output, SNMP_OID_OUTPUT_NUMERIC otherwise.
Return Values
No value is returned.
Notes
Note: snmp_set_oid_output_format() is only available when using the UCD SNMP library. This function is not available when using the Windows SNMP library.
snmp_set_oid_output_format
helbertfernandes at yahoo dot com dot br
02-Dec-2008 01:39
02-Dec-2008 01:39
