newdevice: Removed check for switch model or firmware version for Avaya ERS switches

* Added mempool support for Avaya ERS 3500

* Added mempool support for Avaya ERS 3500

* removed check for  firmware version

* removed check for switch model or firmware version

* removed check for switch model or firmware version

* removed check for switch model or firmware version

* adding @laf suggested changes

* made changes as suggested by @laf

* removed blank line

* removed blank line

* added the snmpwalk back

need this, or it's pointless
This commit is contained in:
Tom Sealey
2017-07-29 11:20:36 +01:00
committed by Neil Lathwood
parent de6af21131
commit f8b795ec95
4 changed files with 26 additions and 53 deletions

View File

@@ -3,15 +3,6 @@
$OID = '.1.3.6.1.4.1.45.1.6.3.8.1.1.12'; $OID = '.1.3.6.1.4.1.45.1.6.3.8.1.1.12';
if ($device['os'] == 'avaya-ers') { if ($device['os'] == 'avaya-ers') {
// Memory information only known to work with 5500 and 5600 switches
if (preg_match('/5[56][0-9][0-9]/', $device['sysDescr'])) {
// Get major version number of running firmware
$fw_major_version = null;
preg_match('/[0-9]\.[0-9]/', $device['version'], $fw_major_version);
$fw_major_version = $fw_major_version[0];
// Temperature info only known to be present in firmware 6.1 or higher
if ($fw_major_version >= 6.1) {
$mem = snmp_walk($device, $OID, '-Osqn'); $mem = snmp_walk($device, $OID, '-Osqn');
echo "$mem\n"; echo "$mem\n";
@@ -22,5 +13,3 @@ if ($device['os'] == 'avaya-ers') {
discover_mempool($valid_mempool, $device, $oid, 'avaya-ers', 'Unit '.($i + 1).' memory', '1', null, null); discover_mempool($valid_mempool, $device, $oid, 'avaya-ers', 'Unit '.($i + 1).' memory', '1', null, null);
} }
} }
}
}

View File

@@ -1,10 +1,7 @@
<?php <?php
if ($device['os'] == 'avaya-ers') { if ($device['os'] == 'avaya-ers') {
// Processor information only know to work with 3500, 5500 and 5600 switches
if (preg_match('/[35][56][0-9][0-9]/', $device['sysDescr'])) {
$procs = snmp_walk($device, '.1.3.6.1.4.1.45.1.6.3.8.1.1.6', '-Osqn'); $procs = snmp_walk($device, '.1.3.6.1.4.1.45.1.6.3.8.1.1.6', '-Osqn');
foreach (explode("\n", $procs) as $i => $t) { foreach (explode("\n", $procs) as $i => $t) {
$t = explode(' ', $t); $t = explode(' ', $t);
$oid = $t[0]; $oid = $t[0];
@@ -12,4 +9,3 @@ if ($device['os'] == 'avaya-ers') {
discover_processor($valid['processor'], $device, $oid, zeropad($i + 1), 'avaya-ers', 'Unit '.($i + 1).' processor', '1', $val, $i, null); discover_processor($valid['processor'], $device, $oid, zeropad($i + 1), 'avaya-ers', 'Unit '.($i + 1).' processor', '1', $val, $i, null);
} }
} }
}

View File

@@ -1,13 +1,5 @@
<?php <?php
// Get major version number of running firmware
$fw_major_version = null;
preg_match('/[0-9]\.[0-9]/', $device['version'], $fw_major_version);
$fw_major_version = $fw_major_version[0];
// Temperature info only known to be present in firmware 6.1 or higher
// Except on ERS 3500 switches, known to exist on firmware 5.1 or higher
if ($fw_major_version >= 5.1) {
$temps = snmp_walk($device, '.1.3.6.1.4.1.45.1.6.3.7.1.1.5.5', '-Osqn'); $temps = snmp_walk($device, '.1.3.6.1.4.1.45.1.6.3.7.1.1.5.5', '-Osqn');
foreach (explode("\n", $temps) as $i => $t) { foreach (explode("\n", $temps) as $i => $t) {
@@ -18,4 +10,3 @@ if ($fw_major_version >= 5.1) {
$val = (trim($val) / 2); $val = (trim($val) / 2);
discover_sensor($valid['sensor'], 'temperature', $device, $oid, zeropad($i + 1), 'avaya-ers', 'Unit '.($i + 1).' temperature', '2', '1', null, null, null, null, $val); discover_sensor($valid['sensor'], 'temperature', $device, $oid, zeropad($i + 1), 'avaya-ers', 'Unit '.($i + 1).' temperature', '2', '1', null, null, null, null, $val);
} }
}

View File

@@ -1,7 +1,5 @@
<?php <?php
// Memory information only known to work with 5500 and 5600 switches
if (preg_match('/5[56][0-9][0-9]/', $device['sysDescr'])) {
$index = $mempool['mempool_index']; $index = $mempool['mempool_index'];
$total = (snmp_get($device, ".1.3.6.1.4.1.45.1.6.3.8.1.1.12$index", '-Oqv') * 1048576); $total = (snmp_get($device, ".1.3.6.1.4.1.45.1.6.3.8.1.1.12$index", '-Oqv') * 1048576);
@@ -10,4 +8,3 @@ if (preg_match('/5[56][0-9][0-9]/', $device['sysDescr'])) {
$mempool['total'] = $total; $mempool['total'] = $total;
$mempool['free'] = $avail; $mempool['free'] = $avail;
$mempool['used'] = ($total - $avail); $mempool['used'] = ($total - $avail);
}