snmpget
(PHP 4, PHP 5, PHP 7, PHP 8)
snmpget — 获取 SNMP 对象
说明
snmpget(
string
string
array|string
int
int
): mixed
string
$hostname,string
$community,array|string
$object_id,int
$timeout = -1,int
$retries = -1): mixed
snmpget() 函数用于读取由 object_id 指定的 SNMP 对象的值。
参数
hostname-
SNMP 代理。
community-
The read community.
object_id-
SNMP 对象。
timeout-
第一次超时前的微秒数。
retries-
发生超时时重试的次数。
返回值
成功时返回 SNMP 对象值,错误时为 false。
示例
示例 #1 使用 snmpget()
<?php
$syscontact = snmpget("127.0.0.1", "public", "system.SysContact.0");
?>