Fixed version detection for HP switches

This commit is contained in:
laf
2015-03-10 14:31:59 +00:00
parent 196f06048b
commit 502fec2cf6

View File

@@ -12,7 +12,7 @@ $hardware = snmp_get($device, "sysObjectID.0", "-OQsv", "SNMPv2-MIB:HH3C-PRODUCT
list(,$version,$features) = explode(",", $poll_device['sysDescr']);
list(,,,$version) = explode(" ", $version);
list(,,$features) = explode(" ", $features);
if (empty($version)) {
if(preg_match('/HP [a-zA-Z0-9-]+ Switch Software Version/',$poll_device['sysDescr'])) {
list($version) = explode("\r", substr($poll_device['sysDescr'], strpos($poll_device['sysDescr'], "Release")+8));
}