From 3b45ea1b37baef930f5e59f8a0396ab1353944b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Rosiak?= Date: Wed, 24 May 2017 23:49:40 +0200 Subject: [PATCH] newdevice: Improve Aerohive Support (#6721) fix #6670 --- includes/definitions/aerohive.yaml | 1 + includes/polling/os/aerohive.inc.php | 3 +++ tests/snmpsim/aerohive_1.snmprec | 2 ++ 3 files changed, 6 insertions(+) create mode 100644 tests/snmpsim/aerohive_1.snmprec diff --git a/includes/definitions/aerohive.yaml b/includes/definitions/aerohive.yaml index 0251e3381c..fa07625bea 100644 --- a/includes/definitions/aerohive.yaml +++ b/includes/definitions/aerohive.yaml @@ -7,3 +7,4 @@ over: discovery: - sysDescr: - HiveOS + - Aerohive diff --git a/includes/polling/os/aerohive.inc.php b/includes/polling/os/aerohive.inc.php index a964fb9f91..0e2f31a9a6 100644 --- a/includes/polling/os/aerohive.inc.php +++ b/includes/polling/os/aerohive.inc.php @@ -12,3 +12,6 @@ if (preg_match('/^(.+?),/', $poll_device['sysDescr'], $hardware)) { $hardware = $store[1]; } +$hardware = trim(snmp_get($device, '.1.3.6.1.4.1.4413.1.1.1.1.1.3.0', '-Ovq'), '"'); +$version = trim(snmp_get($device, '.1.3.6.1.4.1.4413.1.1.1.1.1.13.0', '-Ovq'), '"'); +$serial = trim(snmp_get($device, '.1.3.6.1.4.1.4413.1.1.1.1.1.4.0', '-Ovq'), '"'); diff --git a/tests/snmpsim/aerohive_1.snmprec b/tests/snmpsim/aerohive_1.snmprec new file mode 100644 index 0000000000..f8261a5230 --- /dev/null +++ b/tests/snmpsim/aerohive_1.snmprec @@ -0,0 +1,2 @@ +1.3.6.1.2.1.1.1.0|4|Aerohive SR2348P: 48 GE POE+ ports, 4 XE SFP+ ports, Stackable, 1.0.1.22, Linux 3.6.5 +1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.4413