mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-18 05:26:57 +08:00
154 lines
5.1 KiB
HTML
154 lines
5.1 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 objects including their respective object ID within the specified one</title>
|
|
</head>
|
|
<body class="docs"><div id="layout">
|
|
<div id="layout-content"><div id="function.snmp2-real-walk" class="refentry">
|
|
<div class="refnamediv">
|
|
<h1 class="refname">snmp2_real_walk</h1>
|
|
<p class="verinfo">(PHP >= 5.2.0)</p><p class="refpurpose"><span class="refname">snmp2_real_walk</span> — <span class="dc-title">Return all objects including their respective object ID within the specified one</span></p>
|
|
|
|
</div>
|
|
|
|
<div class="refsect1 description" id="refsect1-function.snmp2-real-walk-description">
|
|
<h3 class="title">说明</h3>
|
|
<div class="methodsynopsis dc-description">
|
|
<span class="methodname"><strong>snmp2_real_walk</strong></span>
|
|
( <span class="methodparam"><span class="type">string</span> <code class="parameter">$host</code></span>
|
|
, <span class="methodparam"><span class="type">string</span> <code class="parameter">$community</code></span>
|
|
, <span class="methodparam"><span class="type">string</span> <code class="parameter">$object_id</code></span>
|
|
[, <span class="methodparam"><span class="type">int</span> <code class="parameter">$timeout</code><span class="initializer"> = 1000000</span></span>
|
|
[, <span class="methodparam"><span class="type">int</span> <code class="parameter">$retries</code><span class="initializer"> = 5</span></span>
|
|
]] ) : <span class="type">array</span></div>
|
|
|
|
<p class="para rdfs-comment">
|
|
The <span class="function"><strong>snmp2_real_walk()</strong></span> function is used to traverse over a number
|
|
of <acronym title="Simple Network Management Protocol">SNMP</acronym> objects starting from <code class="parameter">object_id</code>
|
|
and return not only their values but also their object ids.
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 parameters" id="refsect1-function.snmp2-real-walk-parameters">
|
|
<h3 class="title">参数</h3>
|
|
<dl>
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">host</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
The hostname of the <acronym title="Simple Network Management Protocol">SNMP</acronym> agent (server).
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">community</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
The read community.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">object_id</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
The <acronym title="Simple Network Management Protocol">SNMP</acronym> object id which precedes the wanted one.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">timeout</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
The number of microseconds until the first timeout.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">retries</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
The number of times to retry if timeouts occur.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="refsect1 returnvalues" id="refsect1-function.snmp2-real-walk-returnvalues">
|
|
<h3 class="title">返回值</h3>
|
|
<p class="para">
|
|
Returns an associative array of the <acronym title="Simple Network Management Protocol">SNMP</acronym> object ids and their values on success or <strong><code>FALSE</code></strong> on error.
|
|
In case of an error, an E_WARNING message is shown.
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 examples" id="refsect1-function.snmp2-real-walk-examples">
|
|
<h3 class="title">范例</h3>
|
|
<p class="para">
|
|
<div class="example" id="example-5566">
|
|
<p><strong>Example #1 Using <span class="function"><strong>snmp2_real_walk()</strong></span></strong></p>
|
|
<div class="example-contents">
|
|
<div class="phpcode"><pre><span style="color: #000000">
|
|
<span style="color: #0000BB"><?php<br /> print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">snmp2_real_walk</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::ifName"</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?></span>
|
|
</span>
|
|
</pre></div>
|
|
</div>
|
|
|
|
|
|
<div class="example-contents"><p>
|
|
The above will output something like:
|
|
<div class="cdata"><pre>
|
|
Array
|
|
(
|
|
[IF-MIB::ifName.1] => STRING: lo
|
|
[IF-MIB::ifName.2] => STRING: eth0
|
|
[IF-MIB::ifName.3] => STRING: eth2
|
|
[IF-MIB::ifName.4] => STRING: sit0
|
|
[IF-MIB::ifName.5] => STRING: sixxs
|
|
)
|
|
</pre></div>
|
|
</p></div>
|
|
</div>
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 seealso" id="refsect1-function.snmp2-real-walk-seealso">
|
|
<h3 class="title">参见</h3>
|
|
<p class="para">
|
|
<ul class="simplelist">
|
|
<li class="member"><span class="function"><a href="snmp2_walk.html" class="function" rel="rdfs-seeAlso">snmp2_walk()</a> - Fetch all the SNMP objects from an agent</span></li>
|
|
</ul>
|
|
</p>
|
|
</div>
|
|
|
|
|
|
</div></div></div></body></html> |