mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
newdevice: Add PBN-CP devices.
This commit is contained in:
committed by
Neil Lathwood
parent
8a59adfba5
commit
79d3daabf2
@@ -1874,6 +1874,14 @@ $config['os'][$os]['over'][2]['graph'] = 'device_mempool';
|
||||
$config['os'][$os]['over'][2]['text'] = 'Memory Usage';
|
||||
$config['os'][$os]['icon'] = 'pbn';
|
||||
|
||||
// PBN CPE, Pacific Broadband Networks
|
||||
$os = 'pbn-cp';
|
||||
$config['os'][$os]['text'] = 'PBN P2P CP100 Series Platform';
|
||||
$config['os'][$os]['type'] = 'network';
|
||||
$config['os'][$os]['over'][0]['graph'] = 'device_bits';
|
||||
$config['os'][$os]['over'][0]['text'] = 'Device Traffic';
|
||||
$config['os'][$os]['icon'] = 'pbn';
|
||||
|
||||
// Enterasys
|
||||
$os = 'enterasys';
|
||||
$config['os'][$os]['text'] = 'Enterasys';
|
||||
|
5
includes/discovery/os/pbn-cp.inc.php
Normal file
5
includes/discovery/os/pbn-cp.inc.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
if (starts_with($sysObjectId, '.1.3.6.1.4.1.11606.24')) {
|
||||
$os = 'pbn-cp';
|
||||
}
|
@@ -1,5 +1,8 @@
|
||||
<?php
|
||||
|
||||
if (starts_with($sysObjectId, '.1.3.6.1.4.1.11606')) {
|
||||
if (starts_with($sysObjectId, array(
|
||||
'.1.3.6.1.4.1.11606.10',
|
||||
'.1.3.6.1.4.1.11606.25',
|
||||
))) {
|
||||
$os = 'pbn';
|
||||
}
|
||||
|
9
includes/polling/os/pbn-cp.inc.php
Normal file
9
includes/polling/os/pbn-cp.inc.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
// for PBN CPE 120/121
|
||||
#if (strstr($poll_device['sysObjectID'], '.1.3.6.1.4.1.11606.24.1.1.10')) {
|
||||
$version = str_replace(array('"'), '', snmp_get($device, '1.3.6.1.4.1.11606.24.1.1.6.0', '-Ovq'));
|
||||
$hardware = str_replace(array('"'), '', snmp_get($device, '1.3.6.1.4.1.11606.24.1.1.7.0', '-Ovq'));
|
||||
$features = str_replace(array('"'), '', snmp_get($device, '1.3.6.1.4.1.11606.24.1.1.10.0', '-Ovq'));
|
||||
// normalize MAC address (serial)
|
||||
$serial = str_replace(array(' ', ':', '-', '"'), '', strtolower(snmp_get($device, '1.3.6.1.4.1.11606.24.1.1.4.0', '-Ovq')));
|
||||
#}
|
@@ -3,12 +3,4 @@
|
||||
if (preg_match('/^Pacific Broadband Networks .+\n.+ Version ([^,]+), .+\n.+\n.+\nSerial num:([^,]+), .+/', $poll_device['sysDescr'], $regexp_result)) {
|
||||
$version = $regexp_result[1];
|
||||
$serial = $regexp_result[2];
|
||||
|
||||
// for PBN CPE 120/121
|
||||
} elseif (strstr($poll_device['sysObjectID'], '.1.3.6.1.4.1.11606.24.1.1.10')) {
|
||||
$version = str_replace(array('"'), '', snmp_get($device, '1.3.6.1.4.1.11606.24.1.1.6.0', '-Ovq'));
|
||||
$hardware = str_replace(array('"'), '', snmp_get($device, '1.3.6.1.4.1.11606.24.1.1.7.0', '-Ovq'));
|
||||
$features = str_replace(array('"'), '', snmp_get($device, '1.3.6.1.4.1.11606.24.1.1.10.0', '-Ovq'));
|
||||
// normalize MAC address (serial)
|
||||
$serial = str_replace(array(' ', ':', '-', '"'), '', strtolower(snmp_get($device, '1.3.6.1.4.1.11606.24.1.1.4.0', '-Ovq')));
|
||||
}
|
||||
|
@@ -1009,6 +1009,11 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase
|
||||
$this->checkOS('pbn');
|
||||
}
|
||||
|
||||
public function testPbncpe()
|
||||
{
|
||||
$this->checkOS('pbn-cp');
|
||||
}
|
||||
|
||||
public function testPcoweb()
|
||||
{
|
||||
$this->checkOS('pcoweb');
|
||||
|
1
tests/snmpsim/pbn-cp.snmprec
Normal file
1
tests/snmpsim/pbn-cp.snmprec
Normal file
@@ -0,0 +1 @@
|
||||
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.11606.24
|
@@ -1 +1 @@
|
||||
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.11606
|
||||
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.11606.10
|
||||
|
Reference in New Issue
Block a user