mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-29 13:04:32 +08:00
136 lines
6.6 KiB
HTML
136 lines
6.6 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>Set the OID output format</title>
|
|
</head>
|
|
<body class="docs"><div id="layout">
|
|
<div id="layout-content"><div id="function.snmp-set-oid-output-format" class="refentry">
|
|
<div class="refnamediv">
|
|
<h1 class="refname">snmp_set_oid_output_format</h1>
|
|
<p class="verinfo">(PHP 5 >= 5.2.0, PHP 7)</p><p class="refpurpose"><span class="refname">snmp_set_oid_output_format</span> — <span class="dc-title">
|
|
Set the OID output format
|
|
</span></p>
|
|
|
|
</div>
|
|
<div class="refsect1 description" id="refsect1-function.snmp-set-oid-output-format-description">
|
|
<h3 class="title">说明</h3>
|
|
<div class="methodsynopsis dc-description">
|
|
<span class="methodname"><strong>snmp_set_oid_output_format</strong></span>
|
|
( <span class="methodparam"><span class="type">int</span> <code class="parameter">$oid_format</code><span class="initializer"> = SNMP_OID_OUTPUT_MODULE</span></span>
|
|
) : <span class="type">bool</span></div>
|
|
|
|
<p class="para rdfs-comment">
|
|
<span class="function"><strong>snmp_set_oid_output_format()</strong></span> sets the output format
|
|
to be full or numeric.
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 parameters" id="refsect1-function.snmp-set-oid-output-format-parameters">
|
|
<h3 class="title">参数</h3>
|
|
<p class="para">
|
|
<dl>
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">oid_format</code></dt>
|
|
|
|
<dd>
|
|
|
|
<table class="doctable table">
|
|
<caption><strong>OID .1.3.6.1.2.1.1.3.0 representation for various <code class="parameter">oid_format</code> values</strong></caption>
|
|
|
|
<tbody class="tbody">
|
|
<tr><td><strong><code>SNMP_OID_OUTPUT_FULL</code></strong></td><td>.iso.org.dod.internet.mgmt.mib-2.system.sysUpTime.sysUpTimeInstance</td></tr>
|
|
|
|
<tr><td><strong><code>SNMP_OID_OUTPUT_NUMERIC</code></strong></td><td>.1.3.6.1.2.1.1.3.0</td> </tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<p class="para">Begining from PHP 5.4.0 four additional constants available:
|
|
<table class="doctable table">
|
|
|
|
|
|
<tbody class="tbody">
|
|
<tr><td><strong><code>SNMP_OID_OUTPUT_MODULE</code></strong></td><td>DISMAN-EVENT-MIB::sysUpTimeInstance</td></tr>
|
|
|
|
<tr><td><strong><code>SNMP_OID_OUTPUT_SUFFIX</code></strong></td><td>sysUpTimeInstance</td></tr>
|
|
|
|
<tr><td><strong><code>SNMP_OID_OUTPUT_UCD</code></strong></td><td>system.sysUpTime.sysUpTimeInstance</td></tr>
|
|
|
|
<tr><td><strong><code>SNMP_OID_OUTPUT_NONE</code></strong></td><td>Undefined</td></tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
</dl>
|
|
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 returnvalues" id="refsect1-function.snmp-set-oid-output-format-returnvalues">
|
|
<h3 class="title">返回值</h3>
|
|
<p class="para">
|
|
没有返回值。
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 notes" id="refsect1-function.snmp-set-oid-output-format-notes">
|
|
<h3 class="title">注释</h3>
|
|
<blockquote class="note"><p><strong class="note">Note</strong>:
|
|
<p class="para">
|
|
<span class="function"><strong>snmp_set_oid_output_format()</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 class="refsect1 examples" id="refsect1-function.snmp-set-oid-output-format-examples">
|
|
<h3 class="title">范例</h3>
|
|
<p class="para">
|
|
<div class="example" id="example-5562">
|
|
<p><strong>Example #1 Using <span class="function"><a href="snmprealwalk.html" class="function">snmprealwalk()</a></span></strong></p>
|
|
<div class="example-contents">
|
|
<div class="phpcode"><pre><span style="color: #000000">
|
|
<span style="color: #0000BB"><?php<br /><br /> snmp_read_mib</span><span style="color: #007700">(</span><span style="color: #DD0000">"/usr/share/mibs/netsnmp/NET-SNMP-TC"</span><span style="color: #007700">);<br /><br /> </span><span style="color: #FF8000">// default or SNMP_OID_OUTPUT_MODULE in PHP >= 5.3.6<br /> </span><span style="color: #0000BB">print_r</span><span style="color: #007700">( </span><span style="color: #0000BB">snmprealwalk</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">'RFC1213-MIB::sysObjectID'</span><span style="color: #007700">) );<br /><br /> </span><span style="color: #0000BB">snmp_set_oid_output_format</span><span style="color: #007700">(</span><span style="color: #0000BB">SNMP_OID_OUTPUT_NUMERIC</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">print_r</span><span style="color: #007700">( </span><span style="color: #0000BB">snmprealwalk</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">'RFC1213-MIB::sysObjectID'</span><span style="color: #007700">) );<br /><br /> </span><span style="color: #0000BB">snmp_set_oid_output_format</span><span style="color: #007700">(</span><span style="color: #0000BB">SNMP_OID_OUTPUT_FULL</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">print_r</span><span style="color: #007700">( </span><span style="color: #0000BB">snmprealwalk</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">'RFC1213-MIB::sysObjectID'</span><span style="color: #007700">) );<br /></span><span style="color: #0000BB">?></span>
|
|
</span>
|
|
</pre></div>
|
|
</div>
|
|
|
|
|
|
<div class="example-contents"><p>
|
|
The above would output:
|
|
<div class="cdata"><pre>
|
|
Array
|
|
(
|
|
[RFC1213-MIB::sysObjectID.0] => OID: NET-SNMP-TC::linux
|
|
)
|
|
Array
|
|
(
|
|
[.1.3.6.1.2.1.1.2.0] => OID: .1.3.6.1.4.1.8072.3.2.10
|
|
)
|
|
Array
|
|
(
|
|
[.iso.org.dod.internet.mgmt.mib-2.system.sysObjectID.0] => OID: .iso.org.dod.internet.private.enterprises.netSnmp.netSnmpEnumerations.netSnmpAgentOIDs.linux
|
|
)
|
|
</pre></div>
|
|
</p></div>
|
|
</div>
|
|
</p>
|
|
</div>
|
|
|
|
|
|
|
|
</div></div></div></body></html> |