略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: snmp_set_enum_print

2024-12-20

snmp_set_enum_print

(PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8)

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

说明

snmp_set_enum_print(bool $enable): bool

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

参数

enable

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

返回值

总是返回 true

范例

示例 #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
add a noteadd a note

User Contributed Notes 1 note

up
0
dbeecher at tekops dot com
18 years ago
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)

官方地址:https://www.php.net/manual/en/function.snmp-set-enum-print.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3