PHPackages                             opensolutions/oss-snmp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. opensolutions/oss-snmp

ActiveLibrary

opensolutions/oss-snmp
======================

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

v1.0.5(1y ago)11224.1k↑50%58BSD-3-ClausePHPPHP &gt;=5.4.0

Since Nov 28Pushed 3mo ago20 watchersCompare

[ Source](https://github.com/opensolutions/OSS_SNMP)[ Packagist](https://packagist.org/packages/opensolutions/oss-snmp)[ RSS](/packages/opensolutions-oss-snmp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (9)Used By (0)

OSS\_SNMP
=========

[](#oss_snmp)

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

[](#a-php-snmp-library-for-people-who-hate-snmp-mibs-and-oids)

I ([Barry O'Donovan](http://www.barryodonovan.com/)) hate SNMP! But I have to use it on a daily basis with my company, [Open Solutions](http://www.opensolutions.ie/) 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
-------------

[](#documentation)

Please see [the wiki](https://github.com/opensolutions/OSS_SNMP/wiki).

Example Usage
-------------

[](#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
-------

[](#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
------------------------------------------

[](#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](https://github.com/opensolutions/NOCtools/wiki), 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
------------

[](#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
---------------------------

[](#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](http://opensolutions.github.com/OSS_SNMP/doc/).

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance63

Regular maintenance activity

Popularity44

Moderate usage in the ecosystem

Community29

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 84.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~510 days

Recently: every ~548 days

Total

6

Last Release

541d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/804649?v=4)[Barry O'Donovan](/maintainers/barryo)[@barryo](https://github.com/barryo)

---

Top Contributors

[![barryo](https://avatars.githubusercontent.com/u/804649?v=4)](https://github.com/barryo "barryo (240 commits)")[![nickhilliard](https://avatars.githubusercontent.com/u/807258?v=4)](https://github.com/nickhilliard "nickhilliard (6 commits)")[![metalgrid](https://avatars.githubusercontent.com/u/2023652?v=4)](https://github.com/metalgrid "metalgrid (6 commits)")[![sgomez](https://avatars.githubusercontent.com/u/580701?v=4)](https://github.com/sgomez "sgomez (5 commits)")[![feinar](https://avatars.githubusercontent.com/u/2582517?v=4)](https://github.com/feinar "feinar (4 commits)")[![laherre](https://avatars.githubusercontent.com/u/15050240?v=4)](https://github.com/laherre "laherre (3 commits)")[![fooelisa](https://avatars.githubusercontent.com/u/7875777?v=4)](https://github.com/fooelisa "fooelisa (3 commits)")[![jacques](https://avatars.githubusercontent.com/u/2543?v=4)](https://github.com/jacques "jacques (2 commits)")[![wilpig](https://avatars.githubusercontent.com/u/1653882?v=4)](https://github.com/wilpig "wilpig (2 commits)")[![rfc1036](https://avatars.githubusercontent.com/u/3151489?v=4)](https://github.com/rfc1036 "rfc1036 (1 commits)")[![rowanthorpe](https://avatars.githubusercontent.com/u/604508?v=4)](https://github.com/rowanthorpe "rowanthorpe (1 commits)")[![thomas-mangin](https://avatars.githubusercontent.com/u/1227755?v=4)](https://github.com/thomas-mangin "thomas-mangin (1 commits)")[![uixp](https://avatars.githubusercontent.com/u/7681643?v=4)](https://github.com/uixp "uixp (1 commits)")[![laoheimao](https://avatars.githubusercontent.com/u/17297242?v=4)](https://github.com/laoheimao "laoheimao (1 commits)")[![davehope](https://avatars.githubusercontent.com/u/5435716?v=4)](https://github.com/davehope "davehope (1 commits)")[![dowlingw](https://avatars.githubusercontent.com/u/1167455?v=4)](https://github.com/dowlingw "dowlingw (1 commits)")[![elonhub](https://avatars.githubusercontent.com/u/156757?v=4)](https://github.com/elonhub "elonhub (1 commits)")[![gfokkema](https://avatars.githubusercontent.com/u/5970912?v=4)](https://github.com/gfokkema "gfokkema (1 commits)")[![heitorganzeli](https://avatars.githubusercontent.com/u/1523832?v=4)](https://github.com/heitorganzeli "heitorganzeli (1 commits)")[![AleksBelytskyi](https://avatars.githubusercontent.com/u/29863247?v=4)](https://github.com/AleksBelytskyi "AleksBelytskyi (1 commits)")

---

Tags

osssnmpopensolutionsoss\_snmp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/opensolutions-oss-snmp/health.svg)

```
[![Health](https://phpackages.com/badges/opensolutions-oss-snmp/health.svg)](https://phpackages.com/packages/opensolutions-oss-snmp)
```

###  Alternatives

[jacobcyl/ali-oss-storage

aliyun oss filesystem storage for laravel 5+

523566.2k7](/packages/jacobcyl-ali-oss-storage)[johnlui/aliyun-oss

阿里云 OSS 官方 SDK 的 Composer 封装，支持任何 PHP 项目，包括 Laravel、Symfony、TinyLara 等等。

501178.3k6](/packages/johnlui-aliyun-oss)[alphasnow/aliyun-oss-laravel

alibaba cloud object storage service for laravel

182240.7k2](/packages/alphasnow-aliyun-oss-laravel)[iidestiny/flysystem-oss

Flysystem adapter for the Oss storage.

95607.5k26](/packages/iidestiny-flysystem-oss)[yangyifan/upload

上传 SDK for Laravel

12422.6k3](/packages/yangyifan-upload)[opensolutions/oss-framework

Open Solutions' extension to Zend Framework 1.

1135.2k](/packages/opensolutions-oss-framework)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
