mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-18 05:26:57 +08:00
87 lines
4.0 KiB
HTML
87 lines
4.0 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
<title>Return all values that are enums with their enum value instead of the raw integer</title>
|
|
</head>
|
|
<body class="docs"><div id="layout">
|
|
<div id="layout-content"><div id="function.snmp-set-enum-print" class="refentry">
|
|
<div class="refnamediv">
|
|
<h1 class="refname">snmp_set_enum_print</h1>
|
|
<p class="verinfo">(PHP 4 >= 4.3.0, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">snmp_set_enum_print</span> — <span class="dc-title">
|
|
Return all values that are enums with their enum value instead of the raw integer
|
|
</span></p>
|
|
|
|
</div>
|
|
<div class="refsect1 description" id="refsect1-function.snmp-set-enum-print-description">
|
|
<h3 class="title">说明</h3>
|
|
<div class="methodsynopsis dc-description">
|
|
<span class="methodname"><strong>snmp_set_enum_print</strong></span>
|
|
( <span class="methodparam"><span class="type">int</span> <code class="parameter">$enum_print</code></span>
|
|
) : <span class="type">bool</span></div>
|
|
|
|
<p class="para rdfs-comment">
|
|
This function toggles if snmpwalk/snmpget etc. should automatically lookup enum values
|
|
in the MIB and return them together with their human readable string.
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 parameters" id="refsect1-function.snmp-set-enum-print-parameters">
|
|
<h3 class="title">参数</h3>
|
|
<dl>
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">enum_print</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
As the value is interpreted as boolean by the Net-SNMP library, it can only be "0" or "1".
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 examples" id="refsect1-function.snmp-set-enum-print-examples">
|
|
<h3 class="title">范例</h3>
|
|
<p class="para">
|
|
<div class="example" id="example-5561">
|
|
<p><strong>Example #1 Using <span class="function"><strong>snmp_set_enum_print()</strong></span></strong></p>
|
|
<div class="example-contents">
|
|
<div class="phpcode"><pre><span style="color: #000000">
|
|
<span style="color: #0000BB"><?php<br /> snmp_set_enum_print</span><span style="color: #007700">(</span><span style="color: #0000BB">0</span><span style="color: #007700">);<br /> echo </span><span style="color: #0000BB">snmpget</span><span style="color: #007700">(</span><span style="color: #DD0000">'localhost'</span><span style="color: #007700">, </span><span style="color: #DD0000">'public'</span><span style="color: #007700">, </span><span style="color: #DD0000">'IF-MIB::ifOperStatus.3'</span><span style="color: #007700">) . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /> </span><span style="color: #0000BB">snmp_set_enum_print</span><span style="color: #007700">(</span><span style="color: #0000BB">1</span><span style="color: #007700">);<br /> echo </span><span style="color: #0000BB">snmpget</span><span style="color: #007700">(</span><span style="color: #DD0000">'localhost'</span><span style="color: #007700">, </span><span style="color: #DD0000">'public'</span><span style="color: #007700">, </span><span style="color: #DD0000">'IF-MIB::ifOperStatus.3'</span><span style="color: #007700">) . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?></span>
|
|
</span>
|
|
</pre></div>
|
|
</div>
|
|
|
|
</div>
|
|
</p>
|
|
<p class="para">
|
|
The above would return
|
|
<div class="cdata"><pre>
|
|
INTEGER: up(1)
|
|
INTEGER: 1
|
|
</pre></div>
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 notes" id="refsect1-function.snmp-set-enum-print-notes">
|
|
<h3 class="title">注释</h3>
|
|
<blockquote class="note"><p><strong class="note">Note</strong>:
|
|
<p class="para">
|
|
<span class="function"><strong>snmp_set_enum_print()</strong></span> is only available when using
|
|
the UCD SNMP library. This function is not available when using the
|
|
Windows SNMP library.
|
|
</p>
|
|
</p></blockquote>
|
|
</div>
|
|
|
|
|
|
</div></div></div></body></html> |