PHPackages                             ndum/laravel-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ndum/laravel-snmp

ActiveLaravel[Utility &amp; Helpers](/categories/utility)

ndum/laravel-snmp
=================

A FreeDSx/SNMP SNMP-Wrapper for Laravel

2.1.0(1y ago)1211.5k↓35%4MITPHPPHP &gt;=7.1CI passing

Since Sep 1Pushed 1y ago1 watchersCompare

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

READMEChangelog (10)Dependencies (3)Versions (13)Used By (0)

laravel-snmp
============

[](#laravel-snmp)

This Laravel-Package provides an simple Laravel-Wrapper for the excellent FreeDSx/SNMP class.

Requirements
------------

[](#requirements)

Requires: Laravel &gt;= 5.5 or higher

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

[](#installation)

Install via Composer.

```
$ composer require ndum/laravel-snmp
```

Documentation
-------------

[](#documentation)

The official documentation can be found [here](https://github.com/FreeDSx/SNMP#documentation)

Examples
--------

[](#examples)

##### Traditionally:

[](#traditionally)

```
use Ndum\Laravel\Snmp;

$snmp = new Snmp();
$snmp->newClient('servername', 2, 'secret');
$result = $snmp->getValue('1.3.6.1.2.1.1.5.0'); ## hostname
dd($result);
```

##### Facade:

[](#facade)

```
use Ndum\Laravel\Facades\Snmp;

$snmp = Snmp::newClient('servername', 2, 'secret');
$result = $snmp->getValue('1.3.6.1.2.1.1.5.0'); ## hostname
dd($result);
```

Extras
------

[](#extras)

##### Timeout-Settings:

[](#timeout-settings)

```
use Ndum\Laravel\Snmp;

$snmp = new Snmp();
$snmp->newClient('servername', 2, 'secret');
$snmp->setTimeoutConnectValue(5); # set a value for timeout_connect
$snmp->setTimeoutReadValue(10); # set a value for timeout_read

$result = $snmp->getValue('1.3.6.1.2.1.1.5.0'); ## hostname
dd($result);
```

##### SNMP traps part 1. (sending traps):

[](#snmp-traps-part-1-sending-traps)

***v1***

```
$snmp = new Snmp();
$snmp->newClient('targetserver', 1, 'secret', 162);

# Parameters:
# The enterprise OID to trigger (string)
# The IP address. (string)
# The generic trap type (int)
# The specific trap type (int)
# The system uptime (in seconds/int)
# The OIDs and their values (string/int)
$snmp->sendTrapV1('1.3.6.1.4.1.2021.251.1','localhost', 0, 0, 60, '1.3.6.1.2.1.1.3', 60);
```

***v2c / v3***

```
use Ndum\Laravel\Snmp;

$snmp = new Snmp();
$snmp->newClient('targetserver', 2, 'secret', 162);

# Parameters:
# The system uptime (in seconds/int)
# The trap OID (string)
# The OIDs and their values (string/int)
$snmp->sendTrap(60, '1.3.6.1.4.1.2021.251.1', '1.3.6.1.2.1.1.3', 60));
```

***inform-request (same as v2c / v3 but require a response from target)***

```
use Ndum\Laravel\Snmp;

$snmp = new Snmp();
$snmp->newClient('targetserver', 2, 'secret', 162);

# Parameters:
# The system uptime (in seconds/int)
# The trap OID (string)
# The OIDs and their values (string/int)
$snmp->sendInform(60, '1.3.6.1.4.1.2021.251.1', '1.3.6.1.2.1.1.3', 60));
```

##### SNMP traps part 2. (Receiving traps / trap sink):

[](#snmp-traps-part-2-receiving-traps--trap-sink)

1. First, create a trap listener-class (examples can be found [here](https://github.com/ndum/laravel-snmp/tree/master/examples)
2. Then use it like the following example:

```
use Ndum\Laravel\SnmpTrapServer; # don't forget to use your listener also!

# default options
$options = [
        'ip' => '0.0.0.0',
        'port' => 162,
        'transport' => 'udp',
        'version' => null,
        'community' => null,
        'whitelist' => null,
        'timeout_connect' => 5,
    ];

$listener = new TrapListener(); ### your in step 1 created listener-class

$server = new SnmpTrapServer()
$server->prepare($listener, $options) # $options only needed if other than default
$server->listen();

# in addition: (only if needed)
$server->getOptions(); # to get the options
$server->setOptions($options); # to set the options
```

The official documentation for trap sink can be found [here](https://github.com/FreeDSx/SNMP/blob/master/docs/Server/Trap-Sink.md)

Issues / Contributions
----------------------

[](#issues--contributions)

Directly via GitHub

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance48

Moderate activity, may be stable

Popularity34

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.7% 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 ~170 days

Recently: every ~295 days

Total

11

Last Release

385d ago

Major Versions

1.9.0 → 2.0.02024-05-14

PHP version history (2 changes)1.2.4PHP ^7.1

1.4.0PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f862f9b54b198a56652db65035e528a5780b86bc65ae3ded55dfe07107ac599?d=identicon)[ndum](/maintainers/ndum)

---

Top Contributors

[![ndum](https://avatars.githubusercontent.com/u/18392323?v=4)](https://github.com/ndum "ndum (33 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (1 commits)")

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/ndum-laravel-snmp/health.svg)

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

20917.2M158](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9346.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

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