Merge pull request #1957 from ciscoqid/master

Add support for SonicWALL CPU and memory graphs
This commit is contained in:
Neil Lathwood
2015-09-22 22:42:27 +01:00
6 changed files with 424 additions and 0 deletions
+4
View File
@@ -854,6 +854,10 @@ $config['os'][$os]['text'] = 'SonicWALL';
$config['os'][$os]['type'] = 'firewall';
$config['os'][$os]['over'][0]['graph'] = 'device_bits';
$config['os'][$os]['over'][0]['text'] = 'Traffic';
$config['os'][$os]['over'][1]['graph'] = 'device_processor';
$config['os'][$os]['over'][1]['text'] = 'CPU';
$config['os'][$os]['over'][2]['graph'] = 'device_mempool';
$config['os'][$os]['over'][2]['text'] = 'Memory';
$os = 'zywall';
$config['os'][$os]['text'] = 'ZyXEL ZyWALL';
@@ -0,0 +1,19 @@
<?php
/*
* LibreNMS SonicWALL CPU information module
*
* Copyright (c) 2015 Mark Nagel <mnagel@willingminds.com>
* 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.
*/
if ($device['os'] == 'sonicwall') {
echo 'SonicWALL-MEMORY-POOL: ';
$usage = snmp_get($device, 'SONICWALL-FIREWALL-IP-STATISTICS-MIB::sonicCurrentRAMUtil.0', '-Ovq');
if (is_numeric($usage)) {
discover_mempool($valid_mempool, $device, 0, 'sonicwall-mem', 'Memory Utilization', '100', null, null);
}
}
@@ -0,0 +1,23 @@
<?php
/*
* LibreNMS SonicWALL CPU information module
*
* Copyright (c) 2015 Mark Nagel <mnagel@willingminds.com>
* 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.
*/
if ($device['os'] == 'sonicwall') {
echo 'SonicWALL CPU: ';
$usage_oid = 'SONICWALL-FIREWALL-IP-STATISTICS-MIB::sonicCurrentCPUUtil.0';
$usage = snmp_get($device, $usage_oid, '-Ovqn');
if (is_numeric($usage)) {
discover_processor($valid['processor'], $device, $usage_oid, '0', 'sonicwall', 'CPU', '1', $usage, null, null);
}
}
unset($processors_array);
@@ -0,0 +1,21 @@
<?php
/*
* LibreNMS SonicWALL CPU information module
*
* Copyright (c) 2015 Mark Nagel <mnagel@willingminds.com>
* 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.
*/
if ($device['os'] == 'sonicwall') {
echo 'SonicWALL-MEMORY-POOL: ';
$perc = str_replace('"', "", snmp_get($device, 'SONICWALL-FIREWALL-IP-STATISTICS-MIB::sonicCurrentRAMUtil.0', '-OvQ'));
if (is_numeric($perc)) {
$mempool['perc'] = $perc;
$mempool['used'] = $perc;
$mempool['total'] = 100;
$mempool['free'] = 100 - $perc;
}
}