From 2a211e86dc8372592c44a3462633d4815c362410 Mon Sep 17 00:00:00 2001 From: David Bell Date: Mon, 6 Mar 2017 14:11:10 +0000 Subject: [PATCH] newdevice: Added extrahop detection (#6097) --- html/images/logos/extrahop.svg | 1 + html/images/os/extrahop.svg | 1 + includes/definitions/extrahop.yaml | 11 + includes/discovery/os/linux.inc.php | 2 + includes/polling/os/extrahop.inc.php | 15 ++ mibs/extrahop/EXTRAHOP-MIB | 335 +++++++++++++++++++++++++++ tests/OSDiscoveryTest.php | 5 + tests/snmpsim/extrahop.snmprec | 2 + 8 files changed, 372 insertions(+) create mode 100644 html/images/logos/extrahop.svg create mode 100644 html/images/os/extrahop.svg create mode 100644 includes/definitions/extrahop.yaml create mode 100644 includes/polling/os/extrahop.inc.php create mode 100644 mibs/extrahop/EXTRAHOP-MIB create mode 100644 tests/snmpsim/extrahop.snmprec diff --git a/html/images/logos/extrahop.svg b/html/images/logos/extrahop.svg new file mode 100644 index 0000000000..b1fd6ff684 --- /dev/null +++ b/html/images/logos/extrahop.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/html/images/os/extrahop.svg b/html/images/os/extrahop.svg new file mode 100644 index 0000000000..485fec8785 --- /dev/null +++ b/html/images/os/extrahop.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/includes/definitions/extrahop.yaml b/includes/definitions/extrahop.yaml new file mode 100644 index 0000000000..e8ff66d2bb --- /dev/null +++ b/includes/definitions/extrahop.yaml @@ -0,0 +1,11 @@ +os: extrahop +type: network +group: unix +text: 'Extrahop Appliance' +icon: extrahop +over: + - { graph: device_bits, text: 'Device Traffic' } + - { graph: device_processor, text: 'Processor Usage' } + - { graph: device_mempool, text: 'Memory Usage' } +mib_dir: extrahop +processor_stacked: 1 diff --git a/includes/discovery/os/linux.inc.php b/includes/discovery/os/linux.inc.php index 3848973765..2e12779505 100644 --- a/includes/discovery/os/linux.inc.php +++ b/includes/discovery/os/linux.inc.php @@ -12,6 +12,8 @@ if (starts_with($sysDescr, 'Linux') || starts_with($sysObjectId, '.1.3.6.1.4.1.8 } elseif (snmp_get($device, 'fwVersion.1', '-Osqnv', 'UBNT-AirFIBER-MIB', 'ubnt') !== false) { $os = 'airos-af'; } + } elseif (snmp_get($device, 'extrahopInfoVersionString', '-Osqnv', 'EXTRAHOP-MIB', 'extrahop') !== false) { + $os = 'extrahop'; } elseif (snmp_get($device, 'GANDI-MIB::rxCounter.0', '-Osqnv', 'GANDI-MIB') !== false) { $os = 'pktj'; } elseif (snmp_get($device, 'SFA-INFO::systemName.0', '-Osqnv', 'SFA-INFO') !== false) { diff --git a/includes/polling/os/extrahop.inc.php b/includes/polling/os/extrahop.inc.php new file mode 100644 index 0000000000..7d4d94a40f --- /dev/null +++ b/includes/polling/os/extrahop.inc.php @@ -0,0 +1,15 @@ + + * + * 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. + */ + +$version = snmp_get($device, 'extrahopInfoVersionString', '-Oqv', 'EXTRAHOP-MIB'); diff --git a/mibs/extrahop/EXTRAHOP-MIB b/mibs/extrahop/EXTRAHOP-MIB new file mode 100644 index 0000000000..5fff27768d --- /dev/null +++ b/mibs/extrahop/EXTRAHOP-MIB @@ -0,0 +1,335 @@ +EXTRAHOP-MIB DEFINITIONS ::= BEGIN + +IMPORTS + enterprises FROM SNMPv2-SMI + Counter64 FROM SNMPv2-SMI + OBJECT-TYPE FROM SNMPv2-SMI + DisplayString FROM SNMPv2-TC + NOTIFICATION-TYPE FROM SNMPv2-SMI + OBJECT-GROUP FROM SNMPv2-CONF + NOTIFICATION-GROUP FROM SNMPv2-CONF + MODULE-IDENTITY FROM SNMPv2-SMI; + +extrahop MODULE-IDENTITY + LAST-UPDATED "201505080000Z" + ORGANIZATION "ExtraHop Networks" + CONTACT-INFO + "support@extrahop.com" + DESCRIPTION + "The MIB module for ExtraHop SNMP messages." + REVISION "201505080000Z" + DESCRIPTION + "The latest version of this MIB module." + + ::= { enterprises 32015 } + +extrahopInfo OBJECT IDENTIFIER ::= { extrahop 0 } + +extrahopInfoVersionString OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..255)) + MAX-ACCESS read-only + STATUS current + DESCRIPTION "The full version number of the ExtraHop firmware." + ::= { extrahopInfo 0 } + +extrahopInfoVersionMajor OBJECT-TYPE + SYNTAX Counter64 + MAX-ACCESS read-only + STATUS current + DESCRIPTION "The major version number of the ExtraHop firmware." + ::= { extrahopInfo 1 } + +extrahopInfoVersionMinor OBJECT-TYPE + SYNTAX Counter64 + MAX-ACCESS read-only + STATUS current + DESCRIPTION "The minor version number of the ExtraHop firmware." + ::= { extrahopInfo 2 } + +extrahopInfoVersionBranchRelease OBJECT-TYPE + SYNTAX Counter64 + MAX-ACCESS read-only + STATUS current + DESCRIPTION "The branch release version number of the ExtraHop firmware." + ::= { extrahopInfo 3 } + +extrahopInfoVersionRevision OBJECT-TYPE + SYNTAX Counter64 + MAX-ACCESS read-only + STATUS current + DESCRIPTION "The revision version number of the ExtraHop firmware." + ::= { extrahopInfo 4 } + +extrahopAlert OBJECT IDENTIFIER ::= { extrahop 1 } + +extrahopTraps OBJECT IDENTIFIER ::= { extrahop 2 } + +extrahopObjects OBJECT IDENTIFIER ::= { extrahop 4 } + +extrahopObjectGroup OBJECT-GROUP + OBJECTS { + extrahopAlertName, + extrahopAlertComment, + extrahopAlertObjectType, + extrahopAlertObjectName, + extrahopAlertExpr, + extrahopAlertValue, + extrahopAlertTime, + extrahopAlertObjectId, + extrahopAlertObjectStrId, + extrahopAlertObjectMACAddr, + extrahopAlertObjectIPAddr, + extrahopAlertObjectTags, + extrahopAlertObjectURL, + extrahopAlertStatName, + extrahopAlertStatFieldName, + extrahopAlertSeverity, + extrahopStatsPktsSinceBoot, + extrahopStatsBytesSinceBoot, + extrahopStorageAlertRole, + extrahopStorageAlertDevice, + extrahopStorageAlertStatus, + extrahopStorageAlertDetails, + extrahopStorageAlertSeverity, + extrahopStorageAlertMachine + } + STATUS current + DESCRIPTION "ExtraHop Object Collection" + ::= { extrahopObjects 1 } + +extrahopNotificationGroup NOTIFICATION-GROUP + NOTIFICATIONS { + extrahopAlertTrap, + extrahopStorageAlertTrap + } + STATUS current + DESCRIPTION "ExtraHop Notification Collection" + ::= { extrahopObjects 2 } + +extrahopAlertTrap NOTIFICATION-TYPE + OBJECTS { + extrahopAlertName, + extrahopAlertComment, + extrahopAlertObjectType, + extrahopAlertObjectName, + extrahopAlertExpr, + extrahopAlertValue, + extrahopAlertTime, + extrahopAlertObjectId, + extrahopAlertObjectStrId, + extrahopAlertObjectMACAddr, + extrahopAlertObjectIPAddr, + extrahopAlertObjectTags, + extrahopAlertObjectURL, + extrahopAlertStatName, + extrahopAlertStatFieldName, + extrahopAlertSeverity + } + STATUS current + DESCRIPTION "Alert notification" + ::= { extrahopTraps 1 } + +extrahopAlertName OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..255)) + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Name of the alert" + ::= { extrahopAlert 1} + +extrahopAlertComment OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..255)) + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Alert comment" + ::= { extrahopAlert 2} + +extrahopAlertObjectType OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..255)) + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Type of object alert applies to" + ::= { extrahopAlert 3} + +extrahopAlertObjectName OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..255)) + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Name of object alert applies to" + ::= { extrahopAlert 4} + +extrahopAlertExpr OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..255)) + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Alert expression" + ::= { extrahopAlert 5} + +extrahopAlertValue OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..255)) + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Value that triggered alert" + ::= { extrahopAlert 6} + +extrahopAlertTime OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..255)) + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Time of the alert trigger" + ::= { extrahopAlert 7} + +extrahopAlertObjectId OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..255)) + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Decimal representation of numeric object id" + ::= { extrahopAlert 8} + +extrahopAlertObjectStrId OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..255)) + MAX-ACCESS read-only + STATUS current + DESCRIPTION "String object id" + ::= { extrahopAlert 9} + +extrahopAlertObjectMACAddr OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..255)) + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Object MAC Address" + ::= { extrahopAlert 10} + +extrahopAlertObjectIPAddr OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..255)) + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Object IP Address" + ::= { extrahopAlert 11} + +extrahopAlertObjectTags OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..255)) + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Object tags" + ::= { extrahopAlert 12} + +extrahopAlertObjectURL OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..255)) + MAX-ACCESS read-only + STATUS current + DESCRIPTION "URL" + ::= { extrahopAlert 13} + +extrahopAlertStatName OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..255)) + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Stat name" + ::= { extrahopAlert 14} + +extrahopAlertStatFieldName OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..255)) + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Stat field name" + ::= { extrahopAlert 15} + +extrahopAlertSeverity OBJECT-TYPE + SYNTAX INTEGER { + emergency (0), + alert (1), + critical (2), + error (3), + warning (4), + notice (5), + info (6), + debug (7) + } + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Severity" + ::= { extrahopAlert 16} + +extrahopStats OBJECT IDENTIFIER ::= { extrahop 3 } + +extrahopStatsPktsSinceBoot OBJECT-TYPE + SYNTAX Counter64 + MAX-ACCESS read-only + STATUS current + DESCRIPTION "The number of packets captured since system boot." + ::= { extrahopStats 1 } + +extrahopStatsBytesSinceBoot OBJECT-TYPE + SYNTAX Counter64 + MAX-ACCESS read-only + STATUS current + DESCRIPTION "The number of bytes captured since system boot." + ::= { extrahopStats 2 } + +extrahopStorageAlert OBJECT IDENTIFIER ::= { extrahop 5 } + +extrahopStorageAlertTrap NOTIFICATION-TYPE + OBJECTS { + extrahopStorageAlertRole, + extrahopStorageAlertDevice, + extrahopStorageAlertStatus, + extrahopStorageAlertDetails, + extrahopStorageAlertSeverity, + extrahopStorageAlertMachine + } + STATUS current + DESCRIPTION "Storage notification" + ::= { extrahopTraps 2 } + +extrahopStorageAlertRole OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..255)) + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Role of the storage device" + ::= { extrahopStorageAlert 1} + +extrahopStorageAlertDevice OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..255)) + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Storage device issuing the alert" + ::= { extrahopStorageAlert 2} + +extrahopStorageAlertStatus OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..255)) + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Status of the device" + ::= { extrahopStorageAlert 3} + +extrahopStorageAlertDetails OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..255)) + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Details about the notification" + ::= { extrahopStorageAlert 4} + +extrahopStorageAlertSeverity OBJECT-TYPE + SYNTAX INTEGER { + emergency (0), + alert (1), + critical (2), + error (3), + warning (4), + notice (5), + info (6), + debug (7) + } + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Severity" + ::= { extrahopStorageAlert 5} + +extrahopStorageAlertMachine OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..255)) + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Machine sending alert" + ::= { extrahopStorageAlert 6} + +END diff --git a/tests/OSDiscoveryTest.php b/tests/OSDiscoveryTest.php index e3b418a1be..402d3b5675 100644 --- a/tests/OSDiscoveryTest.php +++ b/tests/OSDiscoveryTest.php @@ -686,6 +686,11 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase $this->checkOS('exinda'); } + public function testExtrahop() + { + $this->checkOS('extrahop'); + } + public function testExtremeware() { $this->checkOS('extremeware'); diff --git a/tests/snmpsim/extrahop.snmprec b/tests/snmpsim/extrahop.snmprec new file mode 100644 index 0000000000..997adaf913 --- /dev/null +++ b/tests/snmpsim/extrahop.snmprec @@ -0,0 +1,2 @@ +1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.8072.3.2.10 +1.3.6.1.4.1.32015.0.0|4|6.1.2.2052