downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

snmp2_set> <snmp2_getnext
[edit] Last updated: Fri, 25 May 2012

view this page in

snmp2_real_walk

(PHP >= 5.2.0)

snmp2_real_walk指定したすべてのオブジェクトとそのオブジェクト ID を返す

説明

array snmp2_real_walk ( string $host , string $community , string $object_id [, string $timeout = 1000000 [, string $retries = 5 ]] )

snmp2_real_walk() 関数は、 object_id から始まる SNMP オブジェクトを走査し、その値とオブジェクト ID を返します。

パラメータ

host

SNMP エージェント (サーバー) のホスト名。

community

リードコミュニティ。

object_id

前にある SNMP オブジェクト ID。

timeout

最初のタイムアウトまでのマイクロ秒数。

retries

タイムアウト発生時の再試行回数。

返り値

成功した場合に SNMP オブジェクト ID とその値の連想配列。エラー時に FALSE を返します。 エラー時には E_WARNING が発生します。

例1 snmp2_real_walk() の使用法

<?php
 print_r
(snmp2_real_walk("localhost""public""IF-MIB::ifName"));
?>

上の例の結果は次のようになります。

    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
    )

参考

  • snmp2_walk() - すべての SNMP オブジェクトをエージェントから取得する



add a note add a note User Contributed Notes snmp2_real_walk
mike dot mackintosh at angrystatic dot com 16-Sep-2011 08:24
Remember that the timeout includes trip time for transport, so setting it too low and sending it across the country will time out and return a 'No response from x.x.x.x'

 
show source | credits | stats | sitemap | contact | advertising | mirror sites