Use the sysDescr we've already polled in the core module

This commit is contained in:
Mike Rostermund
2016-01-15 12:06:28 +01:00
parent a8b476d58f
commit 6f06b74f43

View File

@@ -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];