Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 5800

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!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>Query for a tree of information about a network entity</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.snmpwalk.html">snmpwalk</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="class.snmp.html">SNMP</a></div>
 <div class="up"><a href="ref.snmp.html">SNMP Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.snmpwalkoid" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">snmpwalkoid</h1>
  <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">snmpwalkoid</span> &mdash; <span class="dc-title">Query for a tree of information about a network entity
  </span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.snmpwalkoid-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">array</span> <span class="methodname"><strong>snmpwalkoid</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$hostname</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>
  ]] )</div>


  <p class="para rdfs-comment">
    <span class="function"><strong>snmpwalkoid()</strong></span> function is used to read all object ids
   and their respective values from an SNMP agent specified by  
   <em><code class="parameter">hostname</code></em>.
  </p>

  <p class="para">
   The existence of  <span class="function"><strong>snmpwalkoid()</strong></span> and
    <span class="function"><a href="function.snmpwalk.html" class="function">snmpwalk()</a></span> has historical reasons.  Both
   functions are provided for backward compatibility.
   Use  <span class="function"><a href="function.snmprealwalk.html" class="function">snmprealwalk()</a></span> instead.
  </p> 
 </div>


 <div class="refsect1 parameters" id="refsect1-function.snmpwalkoid-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    <dt>

     <span class="term"><em><code class="parameter">hostname</code></em></span>
     <dd>

      <p class="para">
       The SNMP agent.
      </p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">community</code></em></span>
     <dd>

      <p class="para">
       The read community.
      </p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">object_id</code></em></span>
     <dd>

      <p class="para">
       If <strong><code>NULL</code></strong>, <em><code class="parameter">object_id</code></em> is taken as the root of
       the SNMP objects tree and all objects under that tree are returned as
       an array. 
      </p>
      <p class="para">
       If <em><code class="parameter">object_id</code></em> is specified, all the SNMP objects
       below that <em><code class="parameter">object_id</code></em> are returned.
      </p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">timeout</code></em></span>
     <dd>

      <p class="para">
       The number of microseconds until the first timeout.
      </p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">retries</code></em></span>
     <dd>

      <p class="para">
       The number of times to retry if timeouts occur.
      </p>
     </dd>

    </dt>

   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.snmpwalkoid-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns an associative array with object ids and their respective
   object value starting from the <em><code class="parameter">object_id</code></em>
   as root or <strong><code>FALSE</code></strong> on error.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.snmpwalkoid-examples">
  <h3 class="title">Examples</h3>
  <p class="para"> 
   <div class="example" id="example-4572">
    <p><strong>Example #1  <span class="function"><strong>snmpwalkoid()</strong></span> Example</strong></p>
    <div class="example-contents"> 
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$a&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">snmpwalkoid</span><span style="color: #007700">(</span><span style="color: #DD0000">"127.0.0.1"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"public"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">""</span><span style="color: #007700">);&nbsp;<br />for&nbsp;(</span><span style="color: #0000BB">reset</span><span style="color: #007700">(</span><span style="color: #0000BB">$a</span><span style="color: #007700">);&nbsp;</span><span style="color: #0000BB">$i&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">key</span><span style="color: #007700">(</span><span style="color: #0000BB">$a</span><span style="color: #007700">);&nbsp;</span><span style="color: #0000BB">next</span><span style="color: #007700">(</span><span style="color: #0000BB">$a</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"</span><span style="color: #0000BB">$i</span><span style="color: #DD0000">:&nbsp;</span><span style="color: #0000BB">$a</span><span style="color: #007700">[</span><span style="color: #0000BB">$i</span><span style="color: #007700">]</span><span style="color: #DD0000">&lt;br&nbsp;/&gt;\n"</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p> 
  <p class="para">
   Above function call would return all the SNMP objects from the
   SNMP agent running on localhost. One can step through the values
   with a loop
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.snmpwalkoid-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"> <span class="function"><a href="function.snmpwalk.html" class="function" rel="rdfs-seeAlso">snmpwalk()</a> - Fetch all the SNMP objects from an agent</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.snmpwalk.html">snmpwalk</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="class.snmp.html">SNMP</a></div>
 <div class="up"><a href="ref.snmp.html">SNMP Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>