Skip to content

Commit

Permalink
newdevice: Added support for A10 ACOS devices (librenms#7327)
Browse files Browse the repository at this point in the history
* newdevice: Added support for A10 ACOS devices
  • Loading branch information
laf authored and Rosiak committed Sep 17, 2017
1 parent 18d2995 commit aef7953
Show file tree
Hide file tree
Showing 14 changed files with 12,400 additions and 2 deletions.
Binary file added html/images/os/a10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions includes/definitions/acos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
os: acos
text: 'A10 Networks'
type: network
icon: a10
group: a10
over:
- { graph: device_bits, text: 'Device Traffic' }
- { graph: device_processor, text: 'CPU Usage' }
- { graph: device_mempool, text: 'Memory Usage' }
discovery:
- sysObjectId:
- .1.3.6.1.4.1.22610.1.3
88 changes: 88 additions & 0 deletions includes/definitions/discovery/acos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
mib: mibs/a10/A10-AX-MIB
modules:
sensors:
state:
data:
-
oid: axSysPowerSupplyStatusTable
value: axPowerSupplyStatus
num_oid: .1.3.6.1.4.1.22610.2.4.1.5.12.1.3.
descr: axPowerSupplyName
index: 'axPowerSupplyStatus.{{ $index }}'
states:
- { value: 0, descr: off, graph: 1, generic: 2 }
- { value: 1, descr: on, graph: 1, generic: 0 }
- { value: 2, descr: absent, graph: 1, generic: 1 }
- { value: -1, descr: unknown, graph: 1, generic: 3 }
-
oid: axSysFanStatusTable
value: axFanStatus
num_oid: .1.3.6.1.4.1.22610.2.4.1.5.9.1.3.
descr: axFanName
index: 'axFanStatus.{{ $index }}'
states:
- { value: 0, descr: failed, graph: 1, generic: 2 }
- { value: 4, descr: okFixedHigh, graph: 1, generic: 0 }
- { value: 5, descr: okLowMed, graph: 1, generic: 0 }
- { value: 6, descr: okMedMed, graph: 1, generic: 0 }
- { value: 7, descr: okMedHigh, graph: 1, generic: 0 }
- { value: -2, descr: notReady, graph: 1, generic: 1 }
- { value: -1, descr: unknown, graph: 1, generic: 3 }
-
oid: axPowerSupplyVoltageTable
value: axPowerSupplyVoltageStatus
num_oid: .1.3.6.1.4.1.22610.2.4.1.5.11.1.2.
descr: axPowerSupplyVoltageDescription
index: 'axPowerSupplyVoltageStatus.{{ $index }}'
states:
- { value: 0, descr: invalid, graph: 1, generic: 2 }
- { value: 1, descr: normal, graph: 1, generic: 0 }
- { value: 2, descr: unknown, graph: 1, generic: 3 }
-
oid: axSysHwPhySystemTempStatus
num_oid: .1.3.6.1.4.1.22610.2.4.1.5.5.
descr: System Temp
index: 'axSysHwPhySystemTempStatus.{{ $index }}'
states:
- { value: 0, descr: failed, graph: 1, generic: 2 }
- { value: 1, descr: low-med, graph: 1, generic: 0 }
- { value: 2, descr: med-med, graph: 1, generic: 1 }
- { value: 3, descr: med-high, graph: 1, generic: 1 }
- { value: 4, descr: ok, graph: 1, generic: 0 }
voltage:
data:
-
oid: axPowerSupplyVoltageTotal
num_oid: .1.3.6.1.4.1.22610.2.4.1.5.10.
index: 'axPowerSupplyVoltageTotal.{{ $index }}'
descr: Power Supply
fanspeed:
data:
-
oid: axSysFanStatusTable
value: axFanSpeed
num_oid: .1.3.6.1.4.1.22610.2.4.1.5.9.1.4.
descr: axFanName
index: 'axFanName.{{ $index }}'
-
oid: axSysHwFan1Speed
num_oid: .1.3.6.1.4.1.22610.2.4.1.5.2.
descr: Fan 1 Speed
index: 'axSysHwFan1Speed.{{ $index }}'
-
oid: axSysHwFan2Speed
num_oid: .1.3.6.1.4.1.22610.2.4.1.5.3.
descr: Fan 2 Speed
index: 'axSysHwFan2Speed.{{ $index }}'
-
oid: axSysHwFan3Speed
num_oid: .1.3.6.1.4.1.22610.2.4.1.5.4.
descr: Fan 3 Speed
index: 'axSysHwFan3Speed.{{ $index }}'
temperature:
data:
-
oid: axSysHwPhySystemTemp
num_oid: .1.3.6.1.4.1.22610.2.4.1.5.1.
descr: System Temp
index: 'axSysHwPhySystemTemp.{{ $index }}'
32 changes: 32 additions & 0 deletions includes/discovery/mempools/acos.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php
/**
* acos.inc.php
*
* LibreNMS mempools discovery module for A10 ACOS
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2017 Neil Lathwood
* @author Neil Lathwood <[email protected]>
*/

if ($device['os'] === 'acos') {
echo 'ACOS: ';
$usage = snmp_get($device, 'axSysMemoryUsage.0', '-Ovq', 'A10-AX-MIB');
if (is_numeric($usage)) {
discover_mempool($valid_mempool, $device, 0, 'acos', 'System Memory', '1024', null, null);
}
}
36 changes: 36 additions & 0 deletions includes/discovery/processors/acos.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
/**
* acos.inc.php
*
* LibreNMS processors discovery module for A10 ACOS
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2017 Neil Lathwood
* @author Neil Lathwood <[email protected]>
*/

if ($device['os'] === 'acos') {
echo 'ACOS: ';
$acos_procs = snmpwalk_group($device, 'axSysCpuTable', 'A10-AX-MIB');
foreach ($acos_procs as $proc_index => $proc_info) {
$usage = $proc_info['axSysCpuUsageValue'];
if (is_numeric($usage)) {
$descr = "Proc #$proc_index";
discover_processor($valid['processor'], $device, ".1.3.6.1.4.1.22610.2.4.1.3.2.1.3.$proc_index", $proc_index, 'acos', $descr, '1', $usage, null, null);
}
}
}
31 changes: 31 additions & 0 deletions includes/polling/mempools/acos.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
/**
* acos.inc.php
*
* LibreNMS mempools poller module for A10 ACOS
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2016 Neil Lathwood
* @author Neil Lathwood <[email protected]>
*/

if ($device['os'] === 'acos') {
echo 'ACOS: ';
$mempool['used'] = snmp_get($device, 'axSysMemoryUsage.0', '-Ovq', 'A10-AX-MIB');
$mempool['total'] = snmp_get($device, 'axSysMemoryTotal.0', '-Ovq', 'A10-AX-MIB');
$mempool['free'] = $mempool['total'] - $mempool['used'];
}
28 changes: 28 additions & 0 deletions includes/polling/os/acos.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
/**
* acos.inc.php
*
* LibreNMS os poller module for A10 ACOS
*
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2016 Neil Lathwood
* @author Neil Lathwood <[email protected]>
*/

$acos_temp = snmp_get_multi($device, 'axSysSerialNumber.0 axSysFirmwareVersion.0', '-OQUs', 'A10-AX-MIB');
$serial = $acos_temp[0]['axSysSerialNumber'];
$version = $acos_temp[0]['axSysFirmwareVersion'];
2 changes: 1 addition & 1 deletion includes/snmp.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ function snmp_get_multi($device, $oids, $options = '-OQUs', $mib = null, $mibdir
foreach (explode("\n", $data) as $entry) {
list($oid,$value) = explode('=', $entry, 2);
$oid = trim($oid);
$value = trim($value);
$value = trim($value, "\" \n\r");
list($oid, $index) = explode('.', $oid, 2);
if (!strstr($value, 'at this OID') && isset($oid) && isset($index)) {
$array[$index][$oid] = $value;
Expand Down
Loading

0 comments on commit aef7953

Please sign in to comment.