newdevice: Add PBN-CP devices.

This commit is contained in:
Vitali Kari
2016-11-13 01:13:12 +01:00
committed by Neil Lathwood
parent 8a59adfba5
commit 79d3daabf2
8 changed files with 33 additions and 10 deletions

View File

@@ -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';

View File

@@ -0,0 +1,5 @@
<?php
if (starts_with($sysObjectId, '.1.3.6.1.4.1.11606.24')) {
$os = 'pbn-cp';
}

View File

@@ -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';
}

View 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')));
#}

View File

@@ -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')));
}

View File

@@ -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');

View File

@@ -0,0 +1 @@
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.11606.24

View File

@@ -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