nelisys/snmp

用于 net-snmp 命令的 PHP 类

1.0.0 2015-11-10 09:34 UTC

This package is auto-updated.

Last update: 2024-09-11 22:23:00 UTC


README

用于 net-snmp 命令的 PHP 类

要求

需要: net-snmp-utils

适用于 RedHat/CentOS 6, 7

[root@centos ~]# yum install net-snmp-utils

使用 Composer 安装

$ composer require nelisys/snmp

用法

示例 php 文件。

// test-snmp.php
require 'vendor/autoload.php';

use Nelisys\Snmp;

$snmp = new Snmp('127.0.0.1', 'public');
print_r($snmp->get('.1.3.6.1.2.1.1.1.0'));

测试运行 php 文件。

$ php test-snmp.php
Array
(
    [.1.3.6.1.2.1.1.1.0] => Linux test.example.com
)