From 88a490a969a755c7d33deafb365c74e54768bc7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Rosiak?= Date: Wed, 24 May 2017 07:00:43 +0200 Subject: [PATCH] newdevice: Add support for Halon Gateway (#6716) newdevice: Add support for Halon Gateway --- html/images/os/halon.svg | 3 + includes/definitions/halon.yaml | 9 +++ includes/polling/os/halon.inc.php | 15 ++++ mibs/halon/HALON-SP-MIB | 128 ++++++++++++++++++++++++++++++ tests/snmpsim/halon.snmprec | 2 + 5 files changed, 157 insertions(+) create mode 100644 html/images/os/halon.svg create mode 100644 includes/definitions/halon.yaml create mode 100644 includes/polling/os/halon.inc.php create mode 100644 mibs/halon/HALON-SP-MIB create mode 100644 tests/snmpsim/halon.snmprec diff --git a/html/images/os/halon.svg b/html/images/os/halon.svg new file mode 100644 index 0000000000..8785e55536 --- /dev/null +++ b/html/images/os/halon.svg @@ -0,0 +1,3 @@ + + + diff --git a/includes/definitions/halon.yaml b/includes/definitions/halon.yaml new file mode 100644 index 0000000000..fa749f72ea --- /dev/null +++ b/includes/definitions/halon.yaml @@ -0,0 +1,9 @@ +os: halon +text: Halon +type: appliance +over: + - { graph: device_processor, text: 'Processor Usage' } + - { graph: device_ucd_memory, text: 'Memory Usage' } +discovery: + - sysDescr: + - Halon diff --git a/includes/polling/os/halon.inc.php b/includes/polling/os/halon.inc.php new file mode 100644 index 0000000000..618b101225 --- /dev/null +++ b/includes/polling/os/halon.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. + */ + +$explodeddata = explode("Halon ", $poll_device['sysDescr']); +$version = $explodeddata['1']; +$serial = trim(snmp_get($device, 'HALON-SP-MIB::serialNumber.0', '-OQv'), '"'); diff --git a/mibs/halon/HALON-SP-MIB b/mibs/halon/HALON-SP-MIB new file mode 100644 index 0000000000..37cc2584f8 --- /dev/null +++ b/mibs/halon/HALON-SP-MIB @@ -0,0 +1,128 @@ +HALON-SP-MIB DEFINITIONS ::= BEGIN + IMPORTS + OBJECT-TYPE, MODULE-IDENTITY, enterprises, + Counter64, Integer32 + FROM SNMPv2-SMI; + + halonSecuritySP MODULE-IDENTITY + LAST-UPDATED "201302061107Z" + ORGANIZATION "Halon Security" + CONTACT-INFO "http://www.halon.se" + DESCRIPTION "SNMP MIB for Halon" + + REVISION "201302071132Z" + DESCRIPTION "Initial release" + ::= { halonSecurityProducts 1 } + + + halonSecurity OBJECT IDENTIFIER ::= { enterprises 33234 } + + halonSecurityProducts OBJECT IDENTIFIER ::= { halonSecurity 1 } + + halonSecuritySPObjects OBJECT IDENTIFIER ::= { halonSecuritySP 1 } + + serialNumber OBJECT-TYPE + SYNTAX OCTET STRING + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Serial number" + ::= { halonSecuritySPObjects 1 } + + configurationRevision OBJECT-TYPE + SYNTAX Integer32 + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Running configuration revision" + ::= { halonSecuritySPObjects 2 } + + mailQueueLength OBJECT-TYPE + SYNTAX Counter64 + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Length of mail queue to be delivered" + ::= { halonSecuritySPObjects 3 } + + quarantinedMessages OBJECT-TYPE + SYNTAX Counter64 + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Messages in quarantine" + ::= { halonSecuritySPObjects 4 } + + statTable OBJECT-TYPE + SYNTAX SEQUENCE OF StatEntry + MAX-ACCESS not-accessible + STATUS current + DESCRIPTION "Table containing statistics" + ::= { halonSecuritySPObjects 5 } + + statEntry OBJECT-TYPE + SYNTAX StatEntry + MAX-ACCESS not-accessible + STATUS current + DESCRIPTION "Statistic entry" + INDEX { + statKey1Index, + statKey2Index, + statKey3Index + } + ::= { statTable 1 } + + StatEntry ::= SEQUENCE { + statKey1Index + OCTET STRING, + statKey2Index + OCTET STRING, + statKey3Index + OCTET STRING, + statCount + Counter64, + statCreated + Integer32, + statUpdated + Integer32 + } + + statKey1Index OBJECT-TYPE + SYNTAX OCTET STRING + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Key1" + ::= { statEntry 1 } + + statKey2Index OBJECT-TYPE + SYNTAX OCTET STRING + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Key2" + ::= { statEntry 2 } + + statKey3Index OBJECT-TYPE + SYNTAX OCTET STRING + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Key3" + ::= { statEntry 3 } + + statCount OBJECT-TYPE + SYNTAX Counter64 + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Counter value" + ::= { statEntry 4 } + + statCreated OBJECT-TYPE + SYNTAX Integer32 + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Unix timestamp when created" + ::= { statEntry 5 } + + statUpdated OBJECT-TYPE + SYNTAX Integer32 + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Unix timestamp when last updated" + ::= { statEntry 6 } + +END diff --git a/tests/snmpsim/halon.snmprec b/tests/snmpsim/halon.snmprec new file mode 100644 index 0000000000..52d43468d2 --- /dev/null +++ b/tests/snmpsim/halon.snmprec @@ -0,0 +1,2 @@ +1.3.6.1.2.1.1.1.0|4|Halon 4.1-teamy-amd64 +1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.8072.3.2.8