2012-03-20 16:50:16 +00:00
|
|
|
<?php
|
|
|
|
|
|
2018-01-07 05:00:47 +00:00
|
|
|
if (preg_match('/^Cisco IOS XR Software \(Cisco ([^\)]+)\),\s+Version ([^\[]+)\[([^\]]+)\]/', $device['sysDescr'], $regexp_result)) {
|
2015-07-13 20:10:26 +02:00
|
|
|
$hardware = $regexp_result[1];
|
|
|
|
|
$features = $regexp_result[3];
|
|
|
|
|
$version = $regexp_result[2];
|
2020-01-17 22:04:27 +03:00
|
|
|
} elseif (preg_match('/^Cisco IOS XR Software \(([^\)]+)\),\s+Version\s+([^\s]+)/', $device['sysDescr'], $regexp_result)) {
|
|
|
|
|
$hardware = $regexp_result[1];
|
|
|
|
|
$version = $regexp_result[2];
|
2016-08-28 12:32:58 -05:00
|
|
|
} else {
|
2015-07-13 20:10:26 +02:00
|
|
|
// It is not an IOS-XR ... What should we do ?
|
2012-03-20 16:50:16 +00:00
|
|
|
}
|
|
|
|
|
|
2019-11-16 22:30:40 +03:00
|
|
|
$oids = ['entPhysicalSoftwareRev.1', 'entPhysicalModelName.8384513', 'entPhysicalModelName.8384518'];
|
|
|
|
|
$data = snmp_get_multi($device, $oids, '-OQUs', 'ENTITY-MIB');
|
|
|
|
|
|
|
|
|
|
if (isset($data[1]['entPhysicalSoftwareRev']) && !empty($data[1]['entPhysicalSoftwareRev'])) {
|
|
|
|
|
$version = $data[1]['entPhysicalSoftwareRev'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isset($data[8384518]['entPhysicalModelName']) && !empty($data[8384513]['entPhysicalModelName'])) {
|
|
|
|
|
$hardware = $data[8384513]['entPhysicalModelName'];
|
|
|
|
|
} elseif (isset($data[8384518]['entPhysicalModelName']) && !empty($data[8384518]['entPhysicalModelName'])) {
|
|
|
|
|
$hardware = $data[8384518]['entPhysicalModelName'];
|
|
|
|
|
}
|
|
|
|
|
|
2015-06-18 22:20:50 +01:00
|
|
|
$serial = get_main_serial($device);
|
|
|
|
|
|
2018-01-07 05:00:47 +00:00
|
|
|
echo "\n".$device['sysDescr']."\n";
|