PHPackages                             acamposm/snmp-poller - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. acamposm/snmp-poller

ActiveLibrary[HTTP &amp; Networking](/categories/http)

acamposm/snmp-poller
====================

SNMP poller class

1.1.0(4y ago)164167MITPHPPHP ^8.0

Since Jul 12Pushed 4y ago2 watchersCompare

[ Source](https://github.com/angelcamposm/snmp-poller)[ Packagist](https://packagist.org/packages/acamposm/snmp-poller)[ Docs](https://github.com/acamposm/snmp-poller)[ Patreon](https://www.patreon.com/acamposm)[ RSS](/packages/acamposm-snmp-poller/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

Laravel SNMP Poller Package
===========================

[](#laravel-snmp-poller-package)

[![Packagist PHP Version Support](https://camo.githubusercontent.com/4e19497ff65b559e75e5140d29dfaa916e6b55ea17ff475904be0b7b63538b20/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6163616d706f736d2f736e6d702d706f6c6c6572)](https://camo.githubusercontent.com/4e19497ff65b559e75e5140d29dfaa916e6b55ea17ff475904be0b7b63538b20/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6163616d706f736d2f736e6d702d706f6c6c6572)[![License](https://camo.githubusercontent.com/3b5e1a708063c71d95505205d24a51abac55ac7328826ff63e28fafea8235eef/68747470733a2f2f706f7365722e707567782e6f72672f6163616d706f736d2f736e6d702d706f6c6c65722f6c6963656e7365)](https://packagist.org/packages/acamposm/snmp-poller)[![Latest Stable Version](https://camo.githubusercontent.com/75155b838005fc8004722600fae5a09cd06f9e8265f23835ee568002aa51a2bc/68747470733a2f2f706f7365722e707567782e6f72672f6163616d706f736d2f736e6d702d706f6c6c65722f762f737461626c65)](https://packagist.org/packages/acamposm/snmp-poller)[![StyleCI](https://camo.githubusercontent.com/c04dbea62e3ea94890437dac913ef87c99ad118c1b4713628bfb0f7f1ce153e1/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3235373032313136392f736869656c643f6272616e63683d6d6173746572267374796c653d666c6174)](https://github.styleci.io/repos/257021169)[![Total Downloads](https://camo.githubusercontent.com/e37122efe314eed05356ff0d4a3525d8a15186bad1738409ccee78f3a370e579/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6163616d706f736d2f736e6d702d706f6c6c65722e7376673f7374796c653d666c6174)](https://packagist.org/packages/acamposm/snmp-poller)

[![](img/PackageHeader.png)](img/PackageHeader.png)

This Laravel package allows you to run SNMP queries to the snmp-agent of network hosts through laravel applications.

Before you run any SNMP query in your [Laravel](https://laravel.com/) application, you must install snmp in the operating system and enable the PHP extension **ext-php** in the php.ini to make queries.

- [Installation](#installation)
    - [Requirements](#requirements)
    - [Composer Install](#composer-install)
    - [Publish vendor assets](#publish-vendor-assets)
- [Usage](#usage)
    - [Single SNMP Poller class](#single-snmp-poller-class)
    - [Multiple SNMP Poller classes](#multiple-snmp-poller-classes)
- [Testing](#testing)
- [Changelog](#changelog)
- [Contributing](#contributing)
- [Security](#security)
- [Standards](#standards)
- [Credits](#credits)
- [License](#license)

Installation
------------

[](#installation)

### Requirements

[](#requirements)

At the Operating System level, you need to install net-snmp.

**Debian**

```
apt-get install -y snmp
```

**Centos / RHEL**

```
yum install \
  net-snmp.x86_64 \
  net-snmp-agent-libs.x86_64 \
  net-snmp-libs.x86_64 \
  php-snmp.x86_64
```

At php.ini enable the extension ext-php.

### Composer Install

[](#composer-install)

You can install the package via composer:

```
composer require acamposm/snmp-poller
```

### Publish vendor assets

[](#publish-vendor-assets)

Running this command, you can publish the vendor assets. This allows to modify the default package configuration.

```
php artisan snmp:install
```

Usage
-----

[](#usage)

### Single SNMP Poller class

[](#single-snmp-poller-class)

```
use Acamposm\SnmpPoller\SnmpPoller;
use Acamposm\SnmpPoller\Pollers\IfTablePoller;
use SNMP;

$session = new SNMP(SNMP::VERSION_2C, '192.168.10.254', 'csnmpv2c');

$poller = new SnmpPoller();

$poller->setSnmpSession($session)->addPoller(IfTablePoller::class)->run();
```

The output of an SNMP query to the snmp-agent of a network host with a single SNMP Poller class returns an array of objects with the data inside the data field.

**Note**: For demonstration purposes, all ports between 3 and 22 have been removed from the output of the query.

```
=> [
  "IfTablePoller" => {#653
    +"data": [
      1 => [
        "ifIndex" => 1,
        "ifDescr" => "",
        "ifType" => 6,
        "ifMtu" => 1500,
        "ifSpeed" => 1000000000,
        "ifPhysAddress" => "90:6C:AC:62:82:5B",
        "ifAdminStatus" => 1,
        "ifOperStatus" => 1,
        "ifLastChange" => 0,
        "ifInOctets" => 3808861579,
        "ifInUcastPkts" => 1130144532,
        "ifInDiscards" => 0,
        "ifInErrors" => 2,
        "ifInUnknownProtos" => 0,
        "ifOutOctets" => 1986123900,
        "ifOutUcastPkts" => 735043481,
        "ifOutDiscards" => 0,
        "ifOutErrors" => 0,
      ],
      2 => [
        "ifIndex" => 2,
        "ifDescr" => "",
        "ifType" => 6,
        "ifMtu" => 1500,
        "ifSpeed" => 0,
        "ifPhysAddress" => "90:6C:AC:62:82:5C",
        "ifAdminStatus" => 1,
        "ifOperStatus" => 2,
        "ifLastChange" => 0,
        "ifInOctets" => 0,
        "ifInUcastPkts" => 0,
        "ifInDiscards" => 0,
        "ifInErrors" => 0,
        "ifInUnknownProtos" => 0,
        "ifOutOctets" => 0,
        "ifOutUcastPkts" => 0,
        "ifOutDiscards" => 0,
        "ifOutErrors" => 0,
      ],
      3 => [ ... ],
      4 => [ ... ],
      5 => [ ... ],
      6 => [ ... ],
      7 => [ ... ],
      8 => [ ... ],
      9 => [ ... ],
      10 => [ ... ],
      11 => [ ... ],
      12 => [ ... ],
      13 => [ ... ],
      14 => [ ... ],
      15 => [ ... ],
      16 => [ ... ],
      17 => [ ... ],
      18 => [ ... ],
      19 => [ ... ],
      20 => [ ... ],
      21 => [ ... ],
      22 => [ ... ],
    ],
    +"poller": "Acamposm\SnmpPoller\Pollers\IfTablePoller",
    +"result": "OK",
    +"table": "ifTable",
  },
]

```

### Multiple SNMP Pollers classes

[](#multiple-snmp-pollers-classes)

```
use Acamposm\SnmpPoller\SnmpPoller;
use Acamposm\SnmpPoller\Pollers\IfTablePoller;
use Acamposm\SnmpPoller\Pollers\IfExtendedTablePoller;
use Acamposm\SnmpPoller\Pollers\EntPhysicalTablePoller;
use Acamposm\SnmpPoller\Pollers\LldpRemoteTablePoller;
use SNMP;

$session = new SNMP(SNMP::VERSION_2C, '192.168.10.254', 'csnmpv2c');

$poller = new SnmpPoller();

$pollerClasses = [
   IfTablePoller::class,
   IfExtendedTablePoller::class,
   EntPhysicalTablePoller::class,
   LldpRemoteTablePoller::class,
];

$poller->setSnmpSession($session)
       ->addPollers($pollerClasses)
       ->run();
```

The output of an SNMP query to the snmp-agent of a network host with multiple SNMP Poller classes returns an array of objects with the data inside the data field.

**Note**: For demonstration purposes, all ports between 3 and 22 have been removed from the output of the query.

```
=> [
  "IfTablePoller" => {
    +"data" => [
      1 => [
        "ifIndex" => 1,
        "ifDescr" => "",
        "ifType" => 6,
        "ifMtu" => 1500,
        "ifSpeed" => 1000000000,
        "ifPhysAddress" => "90:6C:AC:62:82:5B",
        "ifAdminStatus" => 1,
        "ifOperStatus" => 1,
        "ifLastChange" => 0,
        "ifInOctets" => 2518775779,
        "ifInUcastPkts" => 1129071509,
        "ifInDiscards" => 0,
        "ifInErrors" => 2,
        "ifInUnknownProtos" => 0,
        "ifOutOctets" => 1941896771,
        "ifOutUcastPkts" => 734653319,
        "ifOutDiscards" => 0,
        "ifOutErrors" => 0,
      ],
      2 => [
        "ifIndex" => 2,
        "ifDescr" => "",
        "ifType" => 6,
        "ifMtu" => 1500,
        "ifSpeed" => 0,
        "ifPhysAddress" => "90:6C:AC:62:82:5C",
        "ifAdminStatus" => 1,
        "ifOperStatus" => 2,
        "ifLastChange" => 0,
        "ifInOctets" => 0,
        "ifInUcastPkts" => 0,
        "ifInDiscards" => 0,
        "ifInErrors" => 0,
        "ifInUnknownProtos" => 0,
        "ifOutOctets" => 0,
        "ifOutUcastPkts" => 0,
        "ifOutDiscards" => 0,
        "ifOutErrors" => 0,
      ],
      3 => [ ... ],
      4 => [ ... ],
      5 => [ ... ],
      6 => [ ... ],
      7 => [ ... ],
      8 => [ ... ],
      9 => [ ... ],
      10 => [ ... ],
      11 => [ ... ],
      12 => [ ... ],
      13 => [ ... ],
      14 => [ ... ],
      15 => [ ... ],
      16 => [ ... ],
      17 => [ ... ],
      18 => [ ... ],
      19 => [ ... ],
      20 => [ ... ],
      21 => [ ... ],
      22 => [ ... ],
    ],
    +"poller": "Acamposm\SnmpPoller\Pollers\IfTablePoller",
    +"result": "OK",
    +"table": "ifTable",
  },
  "IfExtendedTablePoller" => {
    +"data" => [
      1 => [
        "ifName" => "wan1",
        "ifInMulticastPkts" => 0,
        "ifInBroadcastPkts" => 0,
        "ifOutMulticastPkts" => 0,
        "ifOutBroadcastPkts" => 0,
        "ifHCInOctets" => 1123505241577,
        "ifHCInUcastPkts" => 1129071513,
        "ifHCInMulticastPkts" => 0,
        "ifHCInBroadcastPkts" => 0,
        "ifHCOutOctets" => 255344967343,
        "ifHCOutUcastPkts" => 734653320,
        "ifHCOutMulticastPkts" => 0,
        "ifHCOutBroadcastPkts" => 0,
        "ifLinkUpDownTrapEnable" => 1,
        "ifHighSpeed" => 1000,
        "ifPromiscuousMode" => 2,
        "ifConnectorPresent" => 1,
        "ifAlias" => "",
        "ifCounterDiscontinuityTime" => 0,
      ],
      2 => [
        "ifName" => "wan2",
        "ifInMulticastPkts" => 0,
        "ifInBroadcastPkts" => 0,
        "ifOutMulticastPkts" => 0,
        "ifOutBroadcastPkts" => 0,
        "ifHCInOctets" => 0,
        "ifHCInUcastPkts" => 0,
        "ifHCInMulticastPkts" => 0,
        "ifHCInBroadcastPkts" => 0,
        "ifHCOutOctets" => 0,
        "ifHCOutUcastPkts" => 0,
        "ifHCOutMulticastPkts" => 0,
        "ifHCOutBroadcastPkts" => 0,
        "ifLinkUpDownTrapEnable" => 1,
        "ifHighSpeed" => 0,
        "ifPromiscuousMode" => 2,
        "ifConnectorPresent" => 1,
        "ifAlias" => "",
        "ifCounterDiscontinuityTime" => 0,
      ],
      3 => [ ... ],
      4 => [ ... ],
      5 => [ ... ],
      6 => [ ... ],
      7 => [ ... ],
      8 => [ ... ],
      9 => [ ... ],
      10 => [ ... ],
      11 => [ ... ],
      12 => [ ... ],
      13 => [ ... ],
      14 => [ ... ],
      15 => [ ... ],
      16 => [ ... ],
      17 => [ ... ],
      18 => [ ... ],
      19 => [ ... ],
      20 => [ ... ],
      21 => [ ... ],
      22 => [ ... ],
    ],
    +"poller" => "Acamposm\SnmpPoller\Pollers\IfExtendedTablePoller",
    +"result" => "OK",
    +"table" => "ifXTable",
  },
  "EntPhysicalTablePoller" => {
    +"data" => [
      1 => [
        "entPhysicalDescr" => "Fortinet FWF_51E, HW Serial#: FWF51E3U16000691",
        "entPhysicalVendorType" => ".1.3.6.1.4.1.12356.516.516.0",
        "entPhysicalContainedIn" => 0,
        "entPhysicalClass" => 3,
        "entPhysicalParentRelPos" => -1,
        "entPhysicalName" => "FWF_51E",
        "entPhysicalHardwareRev" => "",
        "entPhysicalFirmwareRev" => "",
        "entPhysicalSoftwareRev" => "FortiWiFi-51E v6.2.3,build1066,191218 (GA)",
        "entPhysicalSerialNum" => "FWF51E3U16000691",
        "entPhysicalMfgName" => "Fortinet",
        "entPhysicalModelName" => "FWF_51E",
        "entPhysicalAlias" => "",
        "entPhysicalAssetID" => "",
        "entPhysicalIsFRU" => 1,
      ],
      2 => [
        "entPhysicalDescr" => "Ethernet Port, Vitual Domain: root",
        "entPhysicalVendorType" => ".0.0.0",
        "entPhysicalContainedIn" => 1,
        "entPhysicalClass" => 10,
        "entPhysicalParentRelPos" => 1,
        "entPhysicalName" => "wan1",
        "entPhysicalHardwareRev" => "",
        "entPhysicalFirmwareRev" => "",
        "entPhysicalSoftwareRev" => "",
        "entPhysicalSerialNum" => "",
        "entPhysicalMfgName" => "",
        "entPhysicalModelName" => "",
        "entPhysicalAlias" => "",
        "entPhysicalAssetID" => "",
        "entPhysicalIsFRU" => 2,
      ],
      3 => [
        "entPhysicalDescr" => "Ethernet Port, Vitual Domain: root",
        "entPhysicalVendorType" => ".0.0.0",
        "entPhysicalContainedIn" => 1,
        "entPhysicalClass" => 10,
        "entPhysicalParentRelPos" => 2,
        "entPhysicalName" => "wan2",
        "entPhysicalHardwareRev" => "",
        "entPhysicalFirmwareRev" => "",
        "entPhysicalSoftwareRev" => "",
        "entPhysicalSerialNum" => "",
        "entPhysicalMfgName" => "",
        "entPhysicalModelName" => "",
        "entPhysicalAlias" => "",
        "entPhysicalAssetID" => "",
        "entPhysicalIsFRU" => 2,
      ],
      4 => [
        "entPhysicalDescr" => "Ethernet Port, Vitual Domain: root",
        "entPhysicalVendorType" => ".0.0.0",
        "entPhysicalContainedIn" => 1,
        "entPhysicalClass" => 10,
        "entPhysicalParentRelPos" => 3,
        "entPhysicalName" => "modem",
        "entPhysicalHardwareRev" => "",
        "entPhysicalFirmwareRev" => "",
        "entPhysicalSoftwareRev" => "",
        "entPhysicalSerialNum" => "",
        "entPhysicalMfgName" => "",
        "entPhysicalModelName" => "",
        "entPhysicalAlias" => "",
        "entPhysicalAssetID" => "",
        "entPhysicalIsFRU" => 2,
      ],
    ],
    +"poller": "Acamposm\SnmpPoller\Pollers\EntPhysicalTablePoller",
    +"result": "OK",
    +"table": "entPhysical",
  },
  "LldpRemoteTablePoller" => {
    +"data" => [
      "710800216.10.1" => [
        "lldpRemChassisIdSubtype" => 4,
        "lldpRemChassisId" => "2C:FA:A2:27:2F:5C",
        "lldpRemPortIdSubtype" => 7,
        "lldpRemPortId" => "1021",
        "lldpRemPortDesc" => "Alcatel-Lucent Enterprise 1/21",
        "lldpRemSysName" => "WTG-OS6450P24-SW01",
        "lldpRemSysDesc" => "Alcatel-Lucent Enterprise OS6450-P24 6.7.2.191.R04 GA, June 20, 2018.",
        "lldpRemSysCapSupported" => "(",
        "lldpRemSysCapEnabled" => "(",
      ],
    ],
    +"poller" => "Acamposm\SnmpPoller\Pollers\LldpRemoteTablePoller",
    +"result" => "OK",
    +"table" => "lldpRemTable",
  },
]

```

Testing
-------

[](#testing)

For running the tests, in the console run:

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Standards
---------

[](#standards)

The php package IPv4 Address Converter, comply with the next standards:

- [PSR-1 - Basic Coding Standard](http://www.php-fig.org/psr/psr-1/)
- [PSR-4 - Autoloading Standard](http://www.php-fig.org/psr/psr-4/)
- [PSR-12 - Extended Coding Style Guide](https://www.php-fig.org/psr/psr-12/)

Credits
-------

[](#credits)

- [Angel Campos](https://github.com/acamposm)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~155 days

Total

3

Last Release

1817d ago

Major Versions

0.1.0 → 1.0.02021-05-17

PHP version history (2 changes)0.1.0PHP ^7.4

1.0.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/abe2ce7c293312ef08e979cc3254362328d7b5a1a73c24656afd6077f3b0f2ad?d=identicon)[angel.campos.m](/maintainers/angel.campos.m)

---

Top Contributors

[![angelcamposm](https://avatars.githubusercontent.com/u/63554840?v=4)](https://github.com/angelcamposm "angelcamposm (104 commits)")

---

Tags

laravelnetworkingphpsnmpsnmp-agentsnmpv2snmpv2csnmppollersnmp-polleracamposm

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/acamposm-snmp-poller/health.svg)

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

###  Alternatives

[wn/lumen-generators

A collection of generators for Lumen and Laravel 5.

350205.3k2](/packages/wn-lumen-generators)[laravel-shift/curl-converter

A command line tool to convert curl requests to Laravel HTTP requests.

935.3k](/packages/laravel-shift-curl-converter)[leroy-merlin-br/metamorphosis

Kafka package for laravel applications

4228.8k](/packages/leroy-merlin-br-metamorphosis)

PHPackages © 2026

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