l4rzzz/snmp

There is no license information available for the latest version (0.1.0) of this package.

Interact with network connected devices using SNMP

This package's canonical repository appears to be gone and the package has been frozen as a result.

Maintainers

Details

github.com/l4rzzz/snmp

0.1.0 2019-03-27 19:49 UTC

This package is auto-updated.

Last update: 2023-03-01 00:33:21 UTC


README

PHP Component to interact with network connected devices via SNMP

Classes and associated MIBs

  • L4rzzz\Snmp\Snmp
    This class has 3 public methods where you can pass OIDs to interact with devices. The other classes extend it and use preset methods for specific MIBs.

  • L4rzzz\Snmp\Mgmt\Mib2

    • BRIDGE-MIB
    • ENTITY-MIB
    • IF-MIB
    • IP-MIB
    • SNMPv2-SMI
  • L4rzzz\Snmp\Enterprise\Cisco\Cisco
    Extends L4rzzz\Snmp\Mgmt\Mib2 to use MIBs from the MIB-2 tree.

    • CISCO-VTP-MIB
    • CISCO-VLAN-MEMBERSHIP
  • L4rzzz\Snmp\Enterprise\Cisco\Ccm
    Extends L4rzzz\Snmp\Mgmt\Mib2 to use MIBs from the MIB-2 tree.

    • CISCO-CCM-MIB
  • L4rzzz\Snmp\Enterprise\Infoblox\Infoblox
    Extends L4rzzz\Snmp\Mgmt\Mib2 to use MIBs from the MIB-2 tree.

    • IB-DNSONE-MIB
    • IB-DHCPONE-MIB

Usage

  • Examples

SNMPv2c with custom OID

<?php
use \L4rzzz\Snmp\Snmp;

$auth = ['ro' => 'public'];
$s = new Snmp('10.10.10.10', $auth, 'v2c');

print $s->walk('1.3.6.1.2.1.1.1');

SNMPv3 with MIB-2 methods

<?php
use \L4rzzz\Snmp\Mgmt\Mib2;

$auth = [
    'securityName' => 'foo',
    'securityLevel' => 'AuthPriv',
    'authProtocol' => 'md5',
    'authKey' => 'bar',
    'privProtocol' => 'des',
    'privKey' => 'foobar',
];
$s = new Mib2('10.10.10.10', $auth, 'v3');

print $s->walkIfName();

SNMPv2c with Cisco methods

<?php
use \L4rzzz\Snmp\Enterprise\Cisco\Cisco;

$auth = ['ro' => 'public'];
$s = new Cisco('10.10.10.10', $auth, 'v2c');

print $s->walkVtpVlanName();

//Cisco extends Mib2, Mib2 extends Snmp
//So you can use these methods on Cisco objects too
print $s->walk('1.3.6.1.2.1.1.1');
print $s->walkEntPhysicalDescr();