From a8b476d58f966f313e4fb86bf166422b0228ac68 Mon Sep 17 00:00:00 2001 From: Mike Rostermund Date: Thu, 14 Jan 2016 21:20:38 +0100 Subject: [PATCH 1/2] Added support for hardware, serial, firmware for HP MSM --- includes/polling/os/hpmsm.inc.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 includes/polling/os/hpmsm.inc.php diff --git a/includes/polling/os/hpmsm.inc.php b/includes/polling/os/hpmsm.inc.php new file mode 100644 index 000000000..9d41c038a --- /dev/null +++ b/includes/polling/os/hpmsm.inc.php @@ -0,0 +1,17 @@ + + * 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. + */ + +$sysdescr = snmp_get($device, 'SNMPv2-MIB::sysDescr.0', '-Ovq'); +preg_match_all('/^(MSM\d{3})|Serial number ([\S]+)|Firmware version (\d+\.\d+\.\d+\.\d+-\d+)/', $sysdescr, $matches); +$hardware = $matches[1][0]; +$serial = $matches[2][1]; +$version = $matches[3][2]; From 6f06b74f433b677154a1bccdd255922c2bb65a37 Mon Sep 17 00:00:00 2001 From: Mike Rostermund Date: Fri, 15 Jan 2016 12:06:28 +0100 Subject: [PATCH 2/2] Use the sysDescr we've already polled in the core module --- includes/polling/os/hpmsm.inc.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/includes/polling/os/hpmsm.inc.php b/includes/polling/os/hpmsm.inc.php index 9d41c038a..585db128c 100644 --- a/includes/polling/os/hpmsm.inc.php +++ b/includes/polling/os/hpmsm.inc.php @@ -10,8 +10,7 @@ * the source code distribution for details. */ -$sysdescr = snmp_get($device, 'SNMPv2-MIB::sysDescr.0', '-Ovq'); -preg_match_all('/^(MSM\d{3})|Serial number ([\S]+)|Firmware version (\d+\.\d+\.\d+\.\d+-\d+)/', $sysdescr, $matches); +preg_match_all('/^(MSM\d{3})|Serial number ([\S]+)|Firmware version (\d+\.\d+\.\d+\.\d+-\d+)/', $poll_device['sysDescr'], $matches); $hardware = $matches[1][0]; $serial = $matches[2][1]; $version = $matches[3][2];