downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

snmp_set_oid_numeric_print> <snmp_read_mib
[edit] Last updated: Fri, 25 May 2012

view this page in

snmp_set_enum_print

(PHP 4 >= 4.3.0, PHP 5)

snmp_set_enum_print すべての enum を、実際の整数値ではなく enum 値とともに返す

説明

bool snmp_set_enum_print ( int $enum_print )

この関数は、snmpwalk/snmpget などが自動的に MIB の enum 値を探して可読形式の文字列で返すかどうかを切り替えます。

パラメータ

enum_print

この値は boolean として Net-SNMP ライブラリが解釈します。"0" あるいは "1" しか指定できません。

例1 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";
?>

上の例の結果は次のようになります。

      
 INTEGER: up(1)
 INTEGER: 1

注意

注意:

snmp_set_enum_print() は、 UCB SNMP ライブラリを使用している場合のみ利用可能です。 この関数は、Windows SNMP ライブラリを使用している場合は利用できません。



add a note add a note User Contributed Notes snmp_set_enum_print
dbeecher at tekops dot com 15-Jun-2004 12:23
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)

 
show source | credits | stats | sitemap | contact | advertising | mirror sites