承接 opensolutions/oss-snmp 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

opensolutions/oss-snmp

Composer 安装命令:

composer require opensolutions/oss-snmp

包简介

A PHP SNMP library for people who hate SNMP, MIBs and OIDs!

README 文档

README

A PHP SNMP Library for People Who HATE SNMP, MIBs and OIDs!

I (Barry O'Donovan) hate SNMP! But I have to use it on a daily basis with my company, Open Solutions and our customers.

Don't get me wrong, it's an essential tool in the trade of network engineering but it's also a serious PITA. Finding MIBs, OIBs, making them work, translating them, cross-vendor translations, etc, blah, blah. And then, when you do find what you need, you'll have forgotten it months later when you need it again.

Anyway, while trying to create some automatic L2 topology graphing tools (via Cisco/Foundry Discovery Protocol for example) and also some per VLAN RSTP tools to show port states, I started writing this library which has turned out to be very useful. It is presented here in the hope that the wider network engineering community will find it useful and also contribute back MIBs.

Documentation

Please see the wiki.

Example Usage

First, we need to instantiate an SNMP object with a hostname / IP address and a community string:

$ciscosw = new \OSS_SNMP\SNMP( $ip, $community );

Assuming the above is a standard Cisco switch, let's say I want to get an associate array of VLAN names indexed by the VLAN ids:

print_r( $ciscosw->useCisco_VTP()->vlanNames() );

This yields something like the following:

Array
(
    [1] => default
    [2] => mgmt
    [100] => cust-widgets
    [1002] => fddi-default
    ...
)

It really is that easy. As another example, if you wanted to get the system contact:

echo $ciscosw->useSystem()->contact();

License

This software library is released under the New BSD License (also known as the Modified BSD License). See the LICENSE file or the header of all other files for the full text.

MIBS - The Bad News... with some Good News

The, what I'm calling, MIBs are defined in OSS_SNMP/MIBS and these define the functionality as per the examples above.

There's only a handful of MIBs currently defined - essentially what I've needed so far for other projects.

But it's really easy to add your own. And please send me a pull request for those.

For the MIBs I've written, Iface (MIBS/Iface.php) is fully complete as an example to help future contributors. But there's some really useful functionality in the others. For example the Cisco/CDP MIB can discover your entire L2 network topology recursively. Another project we've released, NOCtools, give concreate examples of this with GraphViz.

Supports SNMP v1, v2c and v3. It's read only as, at time of writing, I have no current requirement to set SNMP values via PHP.

Requirements

PHP 5.4 is a requirement. The reason for 5.4 (besides the fact it's long been regarded as stable), is that we can now dereference an array directly from a function call:

$name = $ciscosw->useCisco_VTP()->vlanNames()[ $vlanid ];

rather than the old way:

$vlanNames = $ciscosw->useCisco_VTP()->vlanNames();
$name = $vlanNames[ $vlanid ];

And as most of the defined MIBs walk a given tree, almost all defined functions return an array.

The only other requirement is the php5-snmp library.

Code / phpDoc Documentation

Documentation can be generated from the root directory by executing:

./bin/phpdoc.sh --force

and it will be found under the doc/ directory. There is an online version available here.

opensolutions/oss-snmp 适用场景与选型建议

opensolutions/oss-snmp 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 25.24k 次下载、GitHub Stars 达 109, 最近一次更新时间为 2014 年 08 月 25 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「snmp」 「oss」 「opensolutions」 「oss_snmp」 「oss-snmp」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 opensolutions/oss-snmp 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 opensolutions/oss-snmp 我们能提供哪些服务?
定制开发 / 二次开发

基于 opensolutions/oss-snmp 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 25.24k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 112
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 109
  • Watchers: 20
  • Forks: 57
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2014-08-25