newdevice: Update comware version and serial number polling (#6686)

This commit is contained in:
Tony Murray
2017-05-19 19:30:11 +01:00
committed by Neil Lathwood
parent c6882129e8
commit 5bb2610488
+6 -4
View File
@@ -8,7 +8,9 @@ echo 'Comware OS...';
$hardware = snmp_get($device, 'sysObjectID.0', '-Osqv', 'SNMPv2-MIB:HH3C-PRODUCT-ID-MIB');
$data = str_replace(",", "", $poll_device['sysDescr']);
$explodeddata = explode(" ", $data);
$version = $explodeddata['6'];
$features = $explodeddata['8'];
preg_match('/Version ([0-9.]+).*Release ([0-9P]+)/', $poll_device['sysDescr'], $version_match);
$version = $version_match[1];
$features = $version_match[2];
$serial_nums = explode("\n", trim(snmp_walk($device, 'hh3cEntityExtManuSerialNum', '-Osqv', 'HH3C-ENTITY-EXT-MIB')));
$serial = $serial_nums[0]; // use the first s/n