snmp_set_oid_output_format

(PHP 5 >= 5.2.0, PHP 7, PHP 8)

snmp_set_oid_output_format Set the OID output format

Description

snmp_set_oid_output_format(int $format): true

snmp_set_oid_output_format() sets the output format to be full or numeric.

Parameters

format
OID .1.3.6.1.2.1.1.3.0 representation for various format values
SNMP_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
SNMP_OID_OUTPUT_MODULEDISMAN-EVENT-MIB::sysUpTimeInstance
SNMP_OID_OUTPUT_SUFFIXsysUpTimeInstance
SNMP_OID_OUTPUT_UCDsystem.sysUpTime.sysUpTimeInstance
SNMP_OID_OUTPUT_NONEUndefined

Return Values

Always returns true.

Changelog

Version Description
8.2.0 The return type is true now; previously, it was bool.

Examples

Example #1 Using snmprealwalk()

<?php

snmp_read_mib
("/usr/share/mibs/netsnmp/NET-SNMP-TC");

// default or SNMP_OID_OUTPUT_MODULE
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
 )

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top