首页 >函数列表 >snmp_set_oid_output_format

snmp_set_oid_output_format

snmp_set_oid_output_format

(PHP 5 >= 5.2.0)

snmp_set_oid_output_format Set the OID output format

说明

bool snmp_set_oid_output_format ( int $oid_format = SNMP_OID_OUTPUT_MODULE )

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

参数

oid_format
OID .1.3.6.1.2.1.1.3.0 representation for various oid_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

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

返回值

没有返回值。

注释

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.

范例

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_rsnmprealwalk('localhost''public''RFC1213-MIB::sysObjectID') );

 
snmp_set_oid_output_format(SNMP_OID_OUTPUT_NUMERIC);
 
print_rsnmprealwalk('localhost''public''RFC1213-MIB::sysObjectID') );

 
snmp_set_oid_output_format(SNMP_OID_OUTPUT_FULL);
 
print_rsnmprealwalk('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
 )


  • snmp2_get
  • snmp2_getnext
  • snmp2_real_walk
  • snmp2_set
  • snmp2_walk
  • snmp3_get
  • snmp3_getnext
  • snmp3_real_walk
  • snmp3_set
  • snmp3_walk
  • snmpget
  • snmpgetnext
  • snmprealwalk
  • snmpset
  • snmpwalk
  • snmpwalkoid
  • snmp_get_quick_print
  • snmp_get_valueretrieval
  • snmp_read_mib
  • snmp_set_enum_print
  • snmp_set_oid_numeric_print
  • snmp_set_oid_output_format
  • snmp_set_quick_print
  • snmp_set_valueretrieval
  • PHP MySQL HTML CSS JavaScript MSSQL AJAX .NET JSP Linux Mac ASP 服务器 SQL jQuery C# C++ java Android IOS oracle MongoDB SQLite wamp 交通频道