with snmpget api, the agent returns the value associated
with the OID (or OIDs) specified in the original request.
The snmpgetnext api is similar, but the agent returns the
value associated with the next (valid) OID
eg:
snmpgetnext('192.168.40.134',
'public',
'SNMPv2-MIB::sysUpTime.0');
will give the output:
STRING: user@hostname
snmpgetnext
(PHP 5)
snmpgetnext — 指定したオブジェクト ID に続く SNMP オブジェクトを取得する
説明
string snmpgetnext
( string
$host
, string $community
, string $object_id
[, int $timeout = 1000000
[, int $retries = 5
]] )
snmpgetnext() 関数は、
object_id で指定したオブジェクトに続く
SNMP オブジェクトの値を取得します。
パラメータ
-
host -
SNMP エージェント (サーバー) のホスト名。
-
community -
リードコミュニティ。
-
object_id -
前にある SNMP オブジェクトの ID。
-
timeout -
最初のタイムアウトまでのマイクロ秒数。
-
retries -
タイムアウト発生時の再試行回数。
返り値
成功した場合に SNMP オブジェクトの値、エラー時に FALSE を返します。
エラー時には E_WARNING が発生します。
例
例1 snmpgetnext() の使用法
<?php
$nameOfSecondInterface = snmpgetnetxt('localhost', 'public', 'IF-MIB::ifName.1';
?>
achalsaraiya at yahoo dot co dot in
25-Mar-2010 02:46
