From d62f2f9d0885ffe144a354528cf4175747bf58ab Mon Sep 17 00:00:00 2001 From: ospfbgp Date: Mon, 29 Aug 2016 15:00:05 -0400 Subject: [PATCH] Update support for avaya-vsp and fix problem in functions.php for avaya-vsp (#4237) newdevice: Improved support for Avaya VSP #4237 --- includes/definitions.inc.php | 2 +- includes/discovery/mempools/avaya-vsp.inc.php | 23 +++++++++++++++ includes/discovery/os/avaya-vsp.inc.php | 28 ++++++++++++++++++- .../discovery/processors/avaya-vsp.inc.php | 16 ++++++++++- includes/functions.php | 2 +- includes/polling/mempools/avaya-vsp.inc.php | 27 ++++++++++++++++++ includes/polling/os/avaya-vsp.inc.php | 22 ++++++++++++--- includes/polling/processors/avaya-vsp.inc.php | 21 ++++++++++++++ 8 files changed, 133 insertions(+), 8 deletions(-) create mode 100644 includes/discovery/mempools/avaya-vsp.inc.php create mode 100644 includes/polling/mempools/avaya-vsp.inc.php create mode 100644 includes/polling/processors/avaya-vsp.inc.php diff --git a/includes/definitions.inc.php b/includes/definitions.inc.php index d036fe9e56..885d2b9d0b 100644 --- a/includes/definitions.inc.php +++ b/includes/definitions.inc.php @@ -1015,7 +1015,7 @@ $config['os'][$os]['type'] = 'network'; $config['os'][$os]['icon'] = 'avaya'; $os = 'avaya-vsp'; -$config['os'][$os]['text'] = 'Avaya VSP'; +$config['os'][$os]['text'] = 'Avaya VOSS'; $config['os'][$os]['type'] = 'network'; $config['os'][$os]['icon'] = 'avaya'; $config['os'][$os]['over'][0]['graph'] = 'device_bits'; diff --git a/includes/discovery/mempools/avaya-vsp.inc.php b/includes/discovery/mempools/avaya-vsp.inc.php new file mode 100644 index 0000000000..1c9bb79a1c --- /dev/null +++ b/includes/discovery/mempools/avaya-vsp.inc.php @@ -0,0 +1,23 @@ + + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. Please see LICENSE.txt at the top level of + * the source code distribution for details. + */ + +// Avaya Memory for VSP with OS VOSS +// rcKhiSlotMemUsed 1.3.6.1.4.1.2272.1.85.10.1.1.6.1 +// rcKhiSlotMemFree 1.3.6.1.4.1.2272.1.85.10.1.1.7.1 +// rcKhiSlotMemUtil 1.3.6.1.4.1.2272.1.85.10.1.1.8.1 + +if ($device['os'] == 'avaya-vsp') { + $memutil = trim(snmp_get($device, '.1.3.6.1.4.1.2272.1.85.10.1.1.8.1', '-OvQ')); + if (is_numeric($memutil)) { + discover_mempool($valid_mempool, $device, 0, 'avaya-vsp', 'VSP Memory', '1', null, null); + } +} diff --git a/includes/discovery/os/avaya-vsp.inc.php b/includes/discovery/os/avaya-vsp.inc.php index 8884bc42e6..7bce3ab522 100644 --- a/includes/discovery/os/avaya-vsp.inc.php +++ b/includes/discovery/os/avaya-vsp.inc.php @@ -3,6 +3,7 @@ * LibreNMS * * Copyright (c) 2016 Neil Lathwood + * Copyright (c) 2016 Daniel Cox * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your @@ -11,7 +12,32 @@ */ if (!$os) { - if (strstr($sysDescr, 'VSP-') && strstr($sysObjectId, '.1.3.6.1.4.1.2272.208')) { + if (strstr($sysObjectId, '.1.3.6.1.4.1.2272.202')) { + // VSP-4850GTS + $os = 'avaya-vsp'; + } + if (strstr($sysObjectId, '.1.3.6.1.4.1.2272.203')) { + // VSP-4850GTS-PWR+ + $os = 'avaya-vsp'; + } + if (strstr($sysObjectId, '.1.3.6.1.4.1.2272.205')) { + // VSP-8284XSQ + $os = 'avaya-vsp'; + } + if (strstr($sysObjectId, '.1.3.6.1.4.1.2272.206')) { + // VSP-4450GSX-PWR+ + $os = 'avaya-vsp'; + } + if (strstr($sysObjectId, '.1.3.6.1.4.1.2272.208')) { + // VSP-8404 + $os = 'avaya-vsp'; + } + if (strstr($sysObjectId, '.1.3.6.1.4.1.2272.209')) { + // VSP-7254XSQ + $os = 'avaya-vsp'; + } + if (strstr($sysObjectId, '.1.3.6.1.4.1.2272.210')) { + // VSP-7254XTQ $os = 'avaya-vsp'; } } diff --git a/includes/discovery/processors/avaya-vsp.inc.php b/includes/discovery/processors/avaya-vsp.inc.php index 2a7033e3b1..115e9bd7ae 100644 --- a/includes/discovery/processors/avaya-vsp.inc.php +++ b/includes/discovery/processors/avaya-vsp.inc.php @@ -1,7 +1,21 @@ + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. Please see LICENSE.txt at the top level of + * the source code distribution for details. + */ + +// Avaya mibs for cpu on VOSS +// rcKhiSlotCpuCurrentUtil 1.3.6.1.4.1.2272.1.85.10.1.1.2.1 +// rcKhiSlotCpu5MinAve 1.3.6.1.4.1.2272.1.85.10.1.1.3.1 if ($device['os'] == 'avaya-vsp') { - $oid = '.1.3.6.1.4.1.2272.1.85.10.1.1.2.1'; + $oid = '.1.3.6.1.4.1.2272.1.85.10.1.1.3.1'; $usage = snmp_walk($device, $oid, '-Ovq'); discover_processor($valid['processor'], $device, $oid, 1, 'avaya-vsp', 'VSP Processor', '1', $usage); } diff --git a/includes/functions.php b/includes/functions.php index bcb906d247..a5b9e6ad2c 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -829,7 +829,7 @@ function is_port_valid($port, $device) global $config; - if (strstr($port['ifDescr'], "irtual")) { + if (strstr($port['ifDescr'], "irtual") && strpos($port['ifDescr'], "Virtual Services Platform") === false) { $valid = 0; } else { $valid = 1; diff --git a/includes/polling/mempools/avaya-vsp.inc.php b/includes/polling/mempools/avaya-vsp.inc.php new file mode 100644 index 0000000000..3897118701 --- /dev/null +++ b/includes/polling/mempools/avaya-vsp.inc.php @@ -0,0 +1,27 @@ + + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. Please see LICENSE.txt at the top level of + * the source code distribution for details. + */ + +// Avaya VSP Memory w/ VOSS +// rcKhiSlotMemUsed 1.3.6.1.4.1.2272.1.85.10.1.1.6.1 +// rcKhiSlotMemFree 1.3.6.1.4.1.2272.1.85.10.1.1.7.1 +// rcKhiSlotMemUtil 1.3.6.1.4.1.2272.1.85.10.1.1.8.1 + +$used = (snmp_get($device, "1.3.6.1.4.1.2272.1.85.10.1.1.6.1", '-OvQ') * 1000); +$free = (snmp_get($device, "1.3.6.1.4.1.2272.1.85.10.1.1.7.1", '-OvQ') * 1000); +$perc = snmp_get($device, "1.3.6.1.4.1.2272.1.85.10.1.1.8.1", '-OvQ'); +$total = ($used + $free); +if (is_numeric($used) && is_numeric($free) && is_numeric($perc)) { + $mempool['total'] = $total; + $mempool['free'] = $free; + $mempool['used'] = $used; + $mempool['perc'] = $perc; +} diff --git a/includes/polling/os/avaya-vsp.inc.php b/includes/polling/os/avaya-vsp.inc.php index 15e6fb1fa3..b53226c880 100644 --- a/includes/polling/os/avaya-vsp.inc.php +++ b/includes/polling/os/avaya-vsp.inc.php @@ -3,6 +3,7 @@ * LibreNMS * * Copyright (c) 2016 Neil Lathwood + * Copyright (c) 2016 Daniel Cox * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your @@ -10,7 +11,20 @@ * the source code distribution for details. */ -$temp = explode(' ', $poll_device['sysDescr']); -$hardware = $temp[0]; -$serial = snmp_get($device, 'rcChasSerialNumber', '-Osqv', 'RAPID-CITY'); -$version = snmp_get($device, 'rcSysVersion', '-Osqv', 'RAPID-CITY'); +// rcSysVersion +$version = snmp_get($device, 'rcSysVersion.0', '-Osqv', 'RAPID-CITY'); +$version = explode(' ', $version); +$version = $version[0]; +$version = str_replace('"', '', $version); + +// rcChasSerialNumber +$serial = snmp_get($device, 'rcChasSerialNumber.0', '-Osqv', 'RAPID-CITY'); +$serial = str_replace('"', '', $serial); + +// rcChasHardwareRevision +$sysDescr = $poll_device['sysDescr']; +$sysDescr = explode(' ', $sysDescr); +$sysDescr = $sysDescr[0]; +$hwrevision = snmp_get($device, 'rcChasHardwareRevision.0', '-Osqv', 'RAPID-CITY'); +$hardware = $sysDescr . " HW: $hwrevision"; +$hardware = str_replace('"', '', $hardware); diff --git a/includes/polling/processors/avaya-vsp.inc.php b/includes/polling/processors/avaya-vsp.inc.php new file mode 100644 index 0000000000..4242cdaf98 --- /dev/null +++ b/includes/polling/processors/avaya-vsp.inc.php @@ -0,0 +1,21 @@ + + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. Please see LICENSE.txt at the top level of + * the source code distribution for details. + */ + +// Avaya VSP cpu w/ VOSS +// rcKhiSlotCpuCurrentUtil 1.3.6.1.4.1.2272.1.85.10.1.1.2.1 +// rcKhiSlotCpu5MinAve 1.3.6.1.4.1.2272.1.85.10.1.1.3.1 + +$proc = trim(snmp_get($device, "1.3.6.1.4.1.2272.1.85.10.1.1.3.1", "-Ovq"), '"'); + +if (is_numeric($usage)) { + $proc = ($usage * 100); +}