mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
committed by
Neil Lathwood
parent
de6af21131
commit
f8b795ec95
@@ -3,24 +3,13 @@
|
||||
$OID = '.1.3.6.1.4.1.45.1.6.3.8.1.1.12';
|
||||
|
||||
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];
|
||||
$mem = snmp_walk($device, $OID, '-Osqn');
|
||||
|
||||
// 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');
|
||||
echo "$mem\n";
|
||||
|
||||
echo "$mem\n";
|
||||
|
||||
foreach (explode("\n", $mem) as $i => $t) {
|
||||
$t = explode(' ', $t);
|
||||
$oid = str_replace($OID, '', $t[0]);
|
||||
discover_mempool($valid_mempool, $device, $oid, 'avaya-ers', 'Unit '.($i + 1).' memory', '1', null, null);
|
||||
}
|
||||
}
|
||||
foreach (explode("\n", $mem) as $i => $t) {
|
||||
$t = explode(' ', $t);
|
||||
$oid = str_replace($OID, '', $t[0]);
|
||||
discover_mempool($valid_mempool, $device, $oid, 'avaya-ers', 'Unit '.($i + 1).' memory', '1', null, null);
|
||||
}
|
||||
}
|
||||
|
@@ -1,15 +1,11 @@
|
||||
<?php
|
||||
|
||||
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');
|
||||
|
||||
foreach (explode("\n", $procs) as $i => $t) {
|
||||
$t = explode(' ', $t);
|
||||
$oid = $t[0];
|
||||
$val = $t[1];
|
||||
discover_processor($valid['processor'], $device, $oid, zeropad($i + 1), 'avaya-ers', 'Unit '.($i + 1).' processor', '1', $val, $i, null);
|
||||
}
|
||||
$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) {
|
||||
$t = explode(' ', $t);
|
||||
$oid = $t[0];
|
||||
$val = $t[1];
|
||||
discover_processor($valid['processor'], $device, $oid, zeropad($i + 1), 'avaya-ers', 'Unit '.($i + 1).' processor', '1', $val, $i, null);
|
||||
}
|
||||
}
|
||||
|
@@ -1,21 +1,12 @@
|
||||
<?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];
|
||||
$temps = snmp_walk($device, '.1.3.6.1.4.1.45.1.6.3.7.1.1.5.5', '-Osqn');
|
||||
|
||||
// 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');
|
||||
|
||||
foreach (explode("\n", $temps) as $i => $t) {
|
||||
$t = explode(' ', $t);
|
||||
$oid = $t[0];
|
||||
$val = $t[1];
|
||||
// Sensors are reported as 2 * value
|
||||
$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);
|
||||
}
|
||||
foreach (explode("\n", $temps) as $i => $t) {
|
||||
$t = explode(' ', $t);
|
||||
$oid = $t[0];
|
||||
$val = $t[1];
|
||||
// Sensors are reported as 2 * value
|
||||
$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);
|
||||
}
|
||||
|
@@ -1,13 +1,10 @@
|
||||
<?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);
|
||||
$avail = (snmp_get($device, ".1.3.6.1.4.1.45.1.6.3.8.1.1.13$index", '-Oqv') * 1048576);
|
||||
$total = (snmp_get($device, ".1.3.6.1.4.1.45.1.6.3.8.1.1.12$index", '-Oqv') * 1048576);
|
||||
$avail = (snmp_get($device, ".1.3.6.1.4.1.45.1.6.3.8.1.1.13$index", '-Oqv') * 1048576);
|
||||
|
||||
$mempool['total'] = $total;
|
||||
$mempool['free'] = $avail;
|
||||
$mempool['used'] = ($total - $avail);
|
||||
}
|
||||
$mempool['total'] = $total;
|
||||
$mempool['free'] = $avail;
|
||||
$mempool['used'] = ($total - $avail);
|
||||
|
Reference in New Issue
Block a user