Simplify Comware poller version matching

This commit is contained in:
Kevin Fleshman
2015-03-10 09:07:59 -07:00
parent 8a28bf9d72
commit 6d827c7f3e

View File

@@ -9,11 +9,7 @@ echo("Comware OS...");
$hardware = snmp_get($device, "sysObjectID.0", "-OQsv", "SNMPv2-MIB:HH3C-PRODUCT-ID-MIB", "+".$config['install_dir']."/mibs/h3c");
list(,$version,$features) = explode(",", $poll_device['sysDescr']);
list(,,,$version) = explode(" ", $version);
list(,,$features) = explode(" ", $features);
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));
}
preg_match('/Software Version (.+), Release ([a-zA-Z0-9]+)/',$poll_device['sysDescr'],$match);
list(,$version,$features) = $match;
?>