Adding Sonicwall SMA 400 support (#9555)

* Adding Sonicwall SMA 400 support

* Added metric clients for use in SSL VPN client alerting
* Support for specifying multiple sensors for clients metric
* RAM info supported
* CPU info supported
* Added test data

* Dashes in graph aren't really useful

* Updated test data with script from upstream (#10)

* Fix style errors (#11)

* Now 8 spaces on line 56

* port clients sensor to count
Some sensor cleanups (move all icon definitions to one spot)

* update port data

* add sensor test data.  Make a guess at userLicense output since it is missing.

* cleanup missed items

* typo

* Updating test data

* Fixed missing CPU info

* Recreated test data

* Recreate test data after rebase

* Test data without ignore statements in config
This commit is contained in:
Marvin Kuurstra
2019-01-23 00:00:33 +01:00
committed by Tony Murray
parent 8ce81f2423
commit e2a8349440
10 changed files with 9336 additions and 59 deletions

58
LibreNMS/OS/Sonicwall.php Normal file
View File

@@ -0,0 +1,58 @@
<?php
/*
* LibreNMS
*
* 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.
*
* @package LibreNMS
* @subpackage webui
* @link http://librenms.org
* @copyright 2018 LibreNMS
* @author LibreNMS Contributors
*/
namespace LibreNMS\OS;
use LibreNMS\Device\Processor;
use LibreNMS\Interfaces\Discovery\ProcessorDiscovery;
use LibreNMS\OS;
class Sonicwall extends OS implements ProcessorDiscovery
{
/**
* Discover processors.
* Returns an array of LibreNMS\Device\Processor objects that have been discovered
*
* @return array Processors
*/
public function discoverProcessors()
{
if (starts_with($this->getDevice()['sysObjectID'], '.1.3.6.1.4.1.8741.1')) {
return array(
Processor::discover(
'sonicwall',
$this->getDeviceId(),
'.1.3.6.1.4.1.8741.1.3.1.3.0', // SONICWALL-FIREWALL-IP-STATISTICS-MIB::sonicCurrentCPUUtil.0
0,
'CPU',
1
)
);
} else {
return array(
Processor::discover(
'sonicwall',
$this->getDeviceId(),
$this->getDevice()['sysObjectID'] . '.2.1.3.0', // different OID for each model
0,
'CPU',
1
)
);
}
}
}

View File

@@ -1,8 +0,0 @@
mib: SONICWALL-FIREWALL-IP-STATISTICS-MIB
modules:
processors:
data:
-
oid: sonicCurrentCPUUtil
num_oid: '.1.3.6.1.4.1.8741.1.3.1.3.{{ $index }}'
descr: CPU

View File

@@ -12,7 +12,13 @@
if ($device['os'] == 'sonicwall') {
echo 'SonicWALL-MEMORY-POOL: ';
if (starts_with($device['sysObjectID'], '.1.3.6.1.4.1.8741.6')) {
$usage = snmp_get($device, 'SNWL-SSLVPN-MIB::memoryUtilization.0', '-Ovq');
} else {
$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);
}

View File

@@ -0,0 +1,39 @@
<?php
/*
* LibreNMS
*
* 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.
*
* @package LibreNMS
* @subpackage webui
* @link http://librenms.org
* @copyright 2018 LibreNMS
* @author LibreNMS Contributors
*/
if (starts_with($device['sysObjectID'], '.1.3.6.1.4.1.8741.6')) {
$licenses = snmp_get($device, 'SNWL-SSLVPN-MIB::userLicense.0', '-Ovq');
$licenses = str_replace(' Users', '', $licenses);
$current = snmp_get($device, '.1.3.6.1.4.1.8741.6.2.1.9.0', '-Ovq');
discover_sensor(
$valid['sensor'],
'count',
$device,
'.1.3.6.1.4.1.8741.6.2.1.9.0', // SNWL-SSLVPN-MIB::activeUserLicense.0
0,
'sonicwall',
'SSL VPN clients',
1,
1,
null,
0,
$licenses - 10,
$licenses,
$current
);
}

View File

@@ -11,7 +11,15 @@
*/
echo 'SonicWALL-MEMORY-POOL: ';
$perc = str_replace('"', "", snmp_get($device, 'SONICWALL-FIREWALL-IP-STATISTICS-MIB::sonicCurrentRAMUtil.0', '-OvQ'));
if (starts_with($device['sysObjectID'], '.1.3.6.1.4.1.8741.6')) {
$usage = snmp_get($device, 'SNWL-SSLVPN-MIB::memoryUtilization.0', '-Ovq');
} else {
$usage = snmp_get($device, 'SONICWALL-FIREWALL-IP-STATISTICS-MIB::sonicCurrentRAMUtil.0', '-Ovq');
}
$perc = str_replace('"', "", $usage);
if (is_numeric($perc)) {
$mempool['perc'] = $perc;
$mempool['used'] = $perc;

View File

@@ -0,0 +1,102 @@
-- *****************************************************************
-- SNWL-COMMON-MIB
--
-- 11-09-07 - Initial Version, Mike Uy
-- 03-10-08 - Removed Imports that are not used to prevent warnings
-- in MIB compilation, Mike Uy
-- 04-17-09 - Updated E-mail CONTACT-INFO, Rosalea Real
-- 11-11-09 - Updated SonicWall company address, Mike Uy
-- 07-23-12 - Updated company copyright and organization, Mike Uy
-- 01-06-17 - Updated company copyright and organization, Thomas Tang
--
-- Copyright (c) 2017 SonicWall Inc.
-- All rights reserved.
-- *****************************************************************
SNWL-COMMON-MIB DEFINITIONS ::= BEGIN
IMPORTS
DisplayString FROM SNMPv2-TC
OBJECT-TYPE,
MODULE-IDENTITY FROM SNMPv2-SMI
sonicwallCommon FROM SONICWALL-SMI;
snwlCommonModule MODULE-IDENTITY
LAST-UPDATED "201701060000Z"
ORGANIZATION "SonicWall"
CONTACT-INFO
" SonicWall Inc.
Postal: 5455 Great America Parkway
Santa Clara, CA 95054
USA
Tel: +1 408 745 9600
Fax: +1 408 745 9300
E-mail: support@sonicwall.com"
DESCRIPTION
"This MIB module defines functions and features common
across all SonicWall products and platforms."
REVISION "201701060000Z"
DESCRIPTION "Updated company copyright and organization."
REVISION "200711090000Z"
DESCRIPTION
"Initial Version"
::= { sonicwallCommon 1 }
-- =======================
-- System Group Lists
-- =======================
snwlSys OBJECT IDENTIFIER ::= { snwlCommonModule 1 }
-- Start of System Group --
snwlSysModel OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"System model name and number"
::= { snwlSys 1 }
snwlSysSerialNumber OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"System serial number for this device"
::= { snwlSys 2 }
snwlSysFirmwareVersion OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Current system firmware version"
::= { snwlSys 3 }
snwlSysROMVersion OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Current system ROM version"
::= { snwlSys 4 }
snwlSysAssetNumber OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"user-defined string entry used for asset tracking"
::= { snwlSys 5 }
-- End of System Group --
END

View File

@@ -0,0 +1,191 @@
-- *****************************************************************
-- SNWL-SSLVPN-MIB.MIB
--
-- 04-22-10 - Updated for new OIDs
-- 11-15-09 - Initial version
-- 07-24-12 - Updated company copyright and organization
-- 01-06-17 - Updated company copyright and organization, Derek Yu
-- Copyright (c) 2017 SonicWall Inc.
-- All rights reserved.
-- *****************************************************************
SNWL-SSLVPN-MIB DEFINITIONS ::= BEGIN
IMPORTS
DisplayString FROM SNMPv2-TC
MODULE-IDENTITY,
OBJECT-IDENTITY FROM SNMPv2-SMI
sonicwallSSLVPN FROM SONICWALL-SMI;
sonicwallSSLVPN MODULE-IDENTITY
LAST-UPDATED "201701060000z"
ORGANIZATION "SonicWall"
CONTACT-INFO
" SonicWall Inc.
Postal: 5455 Great America Parkway
Santa Clara, CA 95054
USA
Tel: +1 408 745 9600
Fax: +1 408 745 9300
E-mail: support@sonicwall.com"
DESCRIPTION
"This MIB module defines functions and features for
SonicWall SMA products"
REVISION "201701060000Z"
DESCRIPTION "Updated company copyright and organization."
REVISION "200910260000Z"
DESCRIPTION
"Initial version."
::= { sonicwall 6 }
--
-- top level structure
-- 1.3.6.1.4.1.8741.6
--
-- ===============================================================
-- Reserved for future use
-- sslvpnTrapModule OBJECT IDENTIFIER ::= { sonicwallSSLVPN 1 }
-- ===============================================================
sslvpnSystemModule OBJECT IDENTIFIER ::= { sonicwallSSLVPN 2 }
sslvpnLicenseModule OBJECT IDENTIFIER ::= { sonicwallSSLVPN 3 }
-- =======================
-- sslvpnSystemModule
-- =======================
sslvpnSys OBJECT IDENTIFIER ::= { sslvpnSystemModule 1 }
sslvpnAuthCode OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Authentication code"
::= { sslvpnSys 1 }
cpuType OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"CPU type"
::= { sslvpnSys 2 }
cpuUtilization OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"CPU utilization"
::= { sslvpnSys 3 }
memoryTotal OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Total memory"
::= { sslvpnSys 4 }
memoryUtilization OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Memory utilization"
::= { sslvpnSys 5 }
systemTime OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"System clock time"
::= { sslvpnSys 6 }
systemUptime OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"System up time."
::= { sslvpnSys 7 }
activeUsers OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Active user sessions"
::= { sslvpnSys 8 }
activeUserLicense OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"User licenses in use"
::= { sslvpnSys 9 }
activeNetExtenderConnections OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Active NetExtender connections"
::= { sslvpnSys 10 }
activeVirtualAssistTechnicians OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Active Virtual Assist technicians"
::= { sslvpnSys 11 }
-- =======================
-- sslvpnLicenseModule
-- =======================
sslvpnLicense OBJECT IDENTIFIER ::= { sslvpnLicenseModule 1 }
userLicense OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"User license information."
::= { sslvpnLicense 1 }
viewPointLicense OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"ViewPoint license information."
::= { sslvpnLicense 2 }
virtualAssistLicense OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Virtual assist license information."
::= { sslvpnLicense 3 }
wafLicense OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Web Application license information."
::= { sslvpnLicense 4 }
END

View File

@@ -17,8 +17,10 @@
-- SONICWALL-SMI.MIB, Mike Uy
-- 07-23-12 Updated company copyright and
-- organization, Mike Uy
-- 01-06-17 Updated company copyright and
-- organization, Thomas Tang
--
-- Copyright (c) 2012 DELL Inc.
-- Copyright (c) 2017 SonicWall Inc.
-- All rights reserved.
-- *****************************************************************
@@ -39,67 +41,69 @@ IMPORTS
FROM SNMPv2-SMI;
sonicwall MODULE-IDENTITY
LAST-UPDATED "201207230000Z"
ORGANIZATION "DELL SonicWALL"
LAST-UPDATED "201701060000Z"
ORGANIZATION "SonicWall"
CONTACT-INFO
" DELL SonicWall
" SonicWall Inc.
Postal: 2001 Logic Drive
San Jose, CA 95124-3452
Postal: 5455 Great America Parkway
Santa Clara, CA 95054
USA
Tel: +1 408 745 9600
Fax: +1 408 745 9300
E-mail: products@sonicwall.com"
E-mail: support@sonicwall.com"
DESCRIPTION
"The MIB Module for SonicWALL enterprise."
REVISION "200304220000Z"
DESCRIPTION
"Initial version."
"The MIB Module for SonicWall enterprise."
REVISION "201701060000Z"
DESCRIPTION "Updated company copyright and organization."
REVISION "200701060000Z"
DESCRIPTION "Initial version."
::= { enterprises 8741 }
sonicwallFw OBJECT-IDENTITY
STATUS current
DESCRIPTION
"sonicwallFw is the subtree for the SonicWALL firewall products."
"sonicwallFw is the subtree for the SonicWall firewall products."
::= { sonicwall 1 }
sonicwallCommon OBJECT-IDENTITY
STATUS current
DESCRIPTION
"Subtree for MIBs common for all SonicWALL products"
"Subtree for MIBs common for all SonicWall products"
::= { sonicwall 2 }
sonicwallGMS OBJECT-IDENTITY
STATUS current
DESCRIPTION
"sonicwallGMS is the subtree for the SonicWALL Global Management System products."
"sonicwallGMS is the subtree for the SonicWall Global Management System products."
::= { sonicwall 3 }
sonicwallEmailSec OBJECT-IDENTITY
STATUS current
DESCRIPTION
"sonicwallEmailSec is the subtree for SonicWALL email security products."
"sonicwallEmailSec is the subtree for SonicWall email security products."
::= { sonicwall 4 }
sonicwallDataCenter OBJECT-IDENTITY
STATUS current
DESCRIPTION
"sonicwallDataCenter is the subtree for SonicWALL datacenter operations."
"sonicwallDataCenter is the subtree for SonicWall datacenter operations."
::= { sonicwall 5 }
sonicwallSSLVPN OBJECT-IDENTITY
STATUS current
DESCRIPTION
"sonicwallSSLVPN is the subtree for SonicWALL SSL VPN products."
"sonicwallSSLVPN is the subtree for SonicWall SSL VPN products."
::= { sonicwall 6 }
sonicwallCDP OBJECT-IDENTITY
STATUS current
DESCRIPTION
"sonicwallCDP is the subtree for SonicWALL CDP products."
"sonicwallCDP is the subtree for SonicWall CDP products."
::= { sonicwall 7 }
END

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff