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
Описание
$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".
Примеры
Пример #1 Using snmp_set_enum_print()
<?php
snmp_set_enum_print(0);
echo snmpget('localhost', 'public', 'IF-MIB::ifOperStatus.3') . "\n";
snmp_set_enum_print(1);
echo snmpget('localhost', 'public', 'IF-MIB::ifOperStatus.3') . "\n";
?>
The above would return
INTEGER: up(1) INTEGER: 1
Примечания
Замечание:
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_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
- 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
Коментарии
This function is only available if using NET_SNMP. It is NOT available if using UCD_SNMP. Likewise UCD_SNMP supports some behaviors that NET_SNMP does not. (found limitation by looking in php snmp.c file)