<?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 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.snmp2-walk.php',
    1 => 'snmp2_walk',
    2 => 'Fetch all the SNMP objects from an agent',
  ),
  'up' => 
  array (
    0 => 'ref.snmp.php',
    1 => 'SNMP-Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.snmp2-set.php',
    1 => 'snmp2_set',
  ),
  'next' => 
  array (
    0 => 'function.snmp3-get.php',
    1 => 'snmp3_get',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/snmp/functions/snmp2-walk.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.snmp2-walk" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">snmp2_walk</h1>
  <p class="verinfo">(PHP &gt;= 5.2.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">snmp2_walk</span> &mdash; <span class="dc-title">Fetch all the <abbr title="Simple Network Management Protocol">SNMP</abbr> objects from an agent</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.snmp2-walk-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>snmp2_walk</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="simpara">
   <span class="function"><strong>snmp2_walk()</strong></span> function is used to read all the values from
   an <abbr title="Simple Network Management Protocol">SNMP</abbr> agent specified by the <code class="parameter">hostname</code>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.snmp2-walk-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <dl>
   
    <dt><code class="parameter">hostname</code></dt>
    <dd>
     <span class="simpara">
      The SNMP agent (server).
     </span>
    </dd>
   
   
    <dt><code class="parameter">community</code></dt>
    <dd>
     <span class="simpara">
      The read community.
     </span>
    </dd>
   
   
    <dt><code class="parameter">object_id</code></dt>
    <dd>
     <span class="simpara">
      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 <abbr title="Simple Network Management Protocol">SNMP</abbr> objects tree and all objects under that tree are returned as
      an array.
     </span>
     <span class="simpara">
      If <code class="parameter">object_id</code> is specified, all the <abbr title="Simple Network Management Protocol">SNMP</abbr> objects
      below that <code class="parameter">object_id</code> are returned.
     </span>
    </dd>
   
   
    <dt><code class="parameter">timeout</code></dt>
    <dd>
     <span class="simpara">
      The number of microseconds until the first timeout.
     </span>
    </dd>
   
   
    <dt><code class="parameter">retries</code></dt>
    <dd>
     <span class="simpara">
      The number of times to retry if timeouts occur.
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.snmp2-walk-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="simpara">
   Returns an array of <abbr title="Simple Network Management Protocol">SNMP</abbr> object values 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.snmp2-walk-examples">
  <h3 class="title">Beispiele</h3>
  <div class="example" id="example-1">
   <p><strong>Beispiel #1 <span class="function"><strong>snmp2_walk()</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">snmp2_walk</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 /><br />foreach (</span><span style="color: #0000BB">$a </span><span style="color: #007700">as </span><span style="color: #0000BB">$val</span><span style="color: #007700">) {<br />    echo </span><span style="color: #DD0000">"</span><span style="color: #0000BB">$val</span><span style="color: #DD0000">\n"</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

  </div>
  <p class="simpara">
   Above function call would return all the <abbr title="Simple Network Management Protocol">SNMP</abbr> objects from the
   <abbr title="Simple Network Management Protocol">SNMP</abbr> agent running on localhost. One can step through the values
   with a loop
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.snmp2-walk-seealso">
  <h3 class="title">Siehe auch</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.snmp2-real-walk.php" class="function" rel="rdfs-seeAlso">snmp2_real_walk()</a> - Return all objects including their respective object ID within the specified one</span></li>
  </ul>
 </div>


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