伍佰目录 短网址
  当前位置:海洋目录网 » 站长资讯 » 站长资讯 » 文章详细 订阅RssFeed

PHP - Manual: snmp3_real_walk

来源:网络转载 浏览:89次 时间:2023-05-01
snmp3_set » « snmp3_getnext PHP 手册 函数参考 其它服务 SNMP SNMP 函数

snmp3_real_walk

(PHP 4, PHP 5, PHP 7, PHP 8)

snmp3_real_walk — Return all objects including their respective object ID within the specified one

说明

snmp3_real_walk(
    string $hostname,
    string $security_name,
    string $security_level,
    string $auth_protocol,
    string $auth_passphrase,
    string $privacy_protocol,
    string $privacy_passphrase,
    array|string $object_id,
    int $timeout = -1,
    int $retries = -1
): array|false

The snmp3_real_walk() function is used to traverse over a number of SNMP objects starting from object_id and return not only their values but also their object ids.

参数

hostname

The hostname of the SNMP agent (server).

security_name

the security name, usually some kind of username

security_level

the security level (noAuthNoPriv|authNoPriv|authPriv)

auth_protocol

the authentication protocol (MD5 or SHA)

auth_passphrase

the authentication pass phrase

privacy_protocol

the privacy protocol (DES or AES)

privacy_passphrase

the privacy pass phrase

object_id

The SNMP object id.

timeout

The number of microseconds until the first timeout.

retries

The number of times to retry if timeouts occur.

返回值

Returns an associative array of the SNMP object ids and their values on success or false on error. In case of an error, an E_WARNING message is shown.

范例

示例 #1 Using snmp3_real_walk()

<?php
 var_export(snmp3_real_walk('localhost', 'james', 'authPriv', 'SHA', 'secret007', 'AES', 'secret007', 'IF-MIB::ifName'));
?>

The above will output something like:

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',
)

参见

snmpwalk() - 从代理返回所有的 SNMP 对象
add a note

User Contributed Notes 1 note

up down 2 Anonymous9 years ago Use this function for debug snmp-connection.

<?php
error_reporting(8191);
date_default_timezone_set('Europe/Moscow');
ini_set('display_errors',1);

snmp_test_connection('12.34.56.78', 'guest', 'guest')

function snmp_test_connection($ip, $user, $pass){
    $a = array('noAuthNoPriv','authNoPriv','authPriv');
    $b = array('MD5','SHA');
    $c = array('DES','AES');

    $branch    = '.1.3.6.1.2.1.1.3'; // upTime

    foreach($a as $aPriv)
        foreach($b as $bProt)
            foreach($c as $cPrivProt){
                echo 'time = '.date('Y-m-d H:i:s').'<br/>';
                echo '<b>sec_level=</b>'.$aPriv.'<br/><b>auth_protocol=</b>'.$bProt.'<br/><b>priv_protocol=</b>'.$cPrivProt.'<br/>Request = ';
                var_dump(
                    snmp3_real_walk($ip, $user, $aPriv, $bProt, $pass, $cPrivProt, $pass, $branch)
                );
            }
}

?>
add a note

官方地址:https://www.php.net/manual/en/function.snmp3-real-walk.php

  推荐站点

  • At-lib分类目录At-lib分类目录

    At-lib网站分类目录汇集全国所有高质量网站,是中国权威的中文网站分类目录,给站长提供免费网址目录提交收录和推荐最新最全的优秀网站大全是名站导航之家

    www.at-lib.cn
  • 中国链接目录中国链接目录

    中国链接目录简称链接目录,是收录优秀网站和淘宝网店的网站分类目录,为您提供优质的网址导航服务,也是网店进行收录推广,站长免费推广网站、加快百度收录、增加友情链接和网站外链的平台。

    www.cnlink.org
  • 35目录网35目录网

    35目录免费收录各类优秀网站,全力打造互动式网站目录,提供网站分类目录检索,关键字搜索功能。欢迎您向35目录推荐、提交优秀网站。

    www.35mulu.com
  • 就要爱网站目录就要爱网站目录

    就要爱网站目录,按主题和类别列出网站。所有提交的网站都经过人工审查,确保质量和无垃圾邮件的结果。

    www.912219.com
  • 伍佰目录伍佰目录

    伍佰网站目录免费收录各类优秀网站,全力打造互动式网站目录,提供网站分类目录检索,关键字搜索功能。欢迎您向伍佰目录推荐、提交优秀网站。

    www.wbwb.net