snmp_set_oid_output_format
(PHP 5 >= 5.2.0, PHP 7)
snmp_set_oid_output_format — Set the OID output format
Description
$oid_format
= SNMP_OID_OUTPUT_MODULE
) : boolsnmp_set_oid_output_format() sets the output format to be full or numeric.
Parameters
-
oid_format
-
OID .1.3.6.1.2.1.1.3.0 representation for various oid_format
valuesSNMP_OID_OUTPUT_FULL
.iso.org.dod.internet.mgmt.mib-2.system.sysUpTime.sysUpTimeInstance SNMP_OID_OUTPUT_NUMERIC
.1.3.6.1.2.1.1.3.0 Begining from PHP 5.4.0 four additional constants available:
SNMP_OID_OUTPUT_MODULE
DISMAN-EVENT-MIB::sysUpTimeInstance SNMP_OID_OUTPUT_SUFFIX
sysUpTimeInstance SNMP_OID_OUTPUT_UCD
system.sysUpTime.sysUpTimeInstance SNMP_OID_OUTPUT_NONE
Undefined
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.
Examples
Example #1 Using snmprealwalk()
<?php
snmp_read_mib("/usr/share/mibs/netsnmp/NET-SNMP-TC");
// default or SNMP_OID_OUTPUT_MODULE in PHP >= 5.3.6
print_r( snmprealwalk('localhost', 'public', 'RFC1213-MIB::sysObjectID') );
snmp_set_oid_output_format(SNMP_OID_OUTPUT_NUMERIC);
print_r( snmprealwalk('localhost', 'public', 'RFC1213-MIB::sysObjectID') );
snmp_set_oid_output_format(SNMP_OID_OUTPUT_FULL);
print_r( snmprealwalk('localhost', 'public', 'RFC1213-MIB::sysObjectID') );
?>
The above would output:
Array ( [RFC1213-MIB::sysObjectID.0] => OID: NET-SNMP-TC::linux ) Array ( [.1.3.6.1.2.1.1.2.0] => OID: .1.3.6.1.4.1.8072.3.2.10 ) Array ( [.iso.org.dod.internet.mgmt.mib-2.system.sysObjectID.0] => OID: .iso.org.dod.internet.private.enterprises.netSnmp.netSnmpEnumerations.netSnmpAgentOIDs.linux )
English translation
You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.
Thank you in advance.
Document created the 30/01/2003, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/php-rf-function.snmp-set-oid-output-format.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.