snmp_set_enum_print Return all values that are enums with their enum value instead of the raw integer


snmp_set_enum_print

(PHP 4 >= 4.3.0, PHP 5)

snmp_set_enum_print Return all values that are enums with their enum value instead of the raw integer

说明

bool snmp_set_enum_print ( int $enum_print )

This function toggles if snmpwalk/snmpget etc. should automatically lookup enum values in the MIB and return them together with their human readable string.

参数

enum_print

As the value is interpreted as boolean by the Net-SNMP library, it can only be "0" or "1".

范例

Example #1 Using snmp_set_enum_print()

<?php
 snmp_set_enum_print
(0);
 echo 
snmpget('localhost''public''IF-MIB::ifOperStatus.3') . " ";
 
snmp_set_enum_print(1);
 echo 
snmpget('localhost''public''IF-MIB::ifOperStatus.3') . " ";
?>

The above would return

      
 INTEGER: up(1)
 INTEGER: 1

注释

Note:

snmp_set_enum_print() is only available when using the UCD SNMP library. This function is not available when using the Windows SNMP library.


«  snmp_read_mib
» snmp_set_oid_numeric_print
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3