<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.snmp.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'function.snmpwalkoid.php',
    1 => 'snmpwalkoid',
    2 => 'Query for a tree of information about a network entity',
  ),
  'up' => 
  array (
    0 => 'ref.snmp.php',
    1 => 'SNMP Функції',
  ),
  'prev' => 
  array (
    0 => 'function.snmpwalk.php',
    1 => 'snmpwalk',
  ),
  'next' => 
  array (
    0 => 'class.snmp.php',
    1 => 'SNMP',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/snmp/functions/snmpwalkoid.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.snmpwalkoid" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">snmpwalkoid</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</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">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>snmpwalkoid</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$hostname</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$community</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><span class="type"><a href="language.types.array.php" class="type array">array</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$object_id</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$timeout</code><span class="initializer"> = -1</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$retries</code><span class="initializer"> = -1</span></span><br>): <span class="type"><span class="type"><a href="language.types.array.php" class="type array">array</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></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  
   <code class="parameter">hostname</code>.
  </p>

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


 <div class="refsect1 parameters" id="refsect1-function.snmpwalkoid-parameters">
  <h3 class="title">Параметри</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">hostname</code></dt>
     <dd>
      <p class="para">
       The SNMP agent.
      </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">
       If <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>, <code class="parameter">object_id</code> 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 <code class="parameter">object_id</code> is specified, all the SNMP objects
       below that <code class="parameter">object_id</code> are returned.
      </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>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.snmpwalkoid-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">
   Returns an associative array with object ids and their respective
   object value starting from the <code class="parameter">object_id</code>
   as root or <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> on error.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.snmpwalkoid-examples">
  <h3 class="title">Приклади</h3>
  <p class="para"> 
   <div class="example" id="example-1">
    <p><strong>Приклад #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 </span><span style="color: #007700">= </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">, </span><span style="color: #DD0000">"public"</span><span style="color: #007700">, </span><span style="color: #DD0000">""</span><span style="color: #007700">); <br />for (</span><span style="color: #0000BB">reset</span><span style="color: #007700">(</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: #0000BB">key</span><span style="color: #007700">(</span><span style="color: #0000BB">$a</span><span style="color: #007700">); </span><span style="color: #0000BB">next</span><span style="color: #007700">(</span><span style="color: #0000BB">$a</span><span style="color: #007700">)) {<br />    echo </span><span style="color: #DD0000">"</span><span style="color: #0000BB">$i</span><span style="color: #DD0000">: </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 /&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">Прогляньте також</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.snmpwalk.php" class="function" rel="rdfs-seeAlso">snmpwalk()</a> - Fetch all the SNMP objects from an agent</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>