2009-09-07 11:07:59 +00:00
|
|
|
<?php
|
2016-12-16 16:38:14 +02:00
|
|
|
/**
|
|
|
|
* LibreNMS
|
|
|
|
*
|
|
|
|
* This file is part of LibreNMS.
|
|
|
|
*
|
|
|
|
* @package LibreNMS
|
|
|
|
* @subpackage polling
|
|
|
|
* @copyright (C) 2016 Librenms
|
|
|
|
*/
|
2007-04-08 21:26:41 +00:00
|
|
|
|
2018-01-07 05:00:47 +00:00
|
|
|
if (preg_match('/^Cisco IOS Software, .+? Software \([^\-]+-([^\-]+)-\w\),.+?Version ([^, ]+)/', $device['sysDescr'], $regexp_result)) {
|
2015-07-13 20:10:26 +02:00
|
|
|
$features = $regexp_result[1];
|
|
|
|
$version = $regexp_result[2];
|
2018-01-07 05:00:47 +00:00
|
|
|
} elseif (preg_match('/Cisco Internetwork Operating System Software\s+IOS \(tm\) [^ ]+ Software \([^\-]+-([^\-]+)-\w\),.+?Version ([^, ]+)/', $device['sysDescr'], $regexp_result)) {
|
2015-07-13 20:10:26 +02:00
|
|
|
$features = $regexp_result[1];
|
|
|
|
$version = $regexp_result[2];
|
2016-12-16 16:38:14 +02:00
|
|
|
}
|
|
|
|
|
2018-12-16 07:42:50 -06:00
|
|
|
$oids = ['entPhysicalModelName.1', 'entPhysicalContainedIn.1', 'entPhysicalName.1', 'entPhysicalSoftwareRev.1', 'entPhysicalModelName.1001', 'entPhysicalContainedIn.1001', 'cardDescr.1', 'cardSlotNumber.1'];
|
2015-07-13 20:10:26 +02:00
|
|
|
|
2016-12-16 16:38:14 +02:00
|
|
|
$data = snmp_get_multi($device, $oids, '-OQUs', 'ENTITY-MIB:OLD-CISCO-CHASSIS-MIB');
|
2015-07-13 20:10:26 +02:00
|
|
|
|
2016-12-16 16:38:14 +02:00
|
|
|
if ($data[1]['entPhysicalContainedIn'] == '0') {
|
|
|
|
if (!empty($data[1]['entPhysicalSoftwareRev'])) {
|
|
|
|
$version = $data[1]['entPhysicalSoftwareRev'];
|
|
|
|
}
|
2015-07-13 20:10:26 +02:00
|
|
|
|
2016-12-16 16:38:14 +02:00
|
|
|
if (!empty($data[1]['entPhysicalName'])) {
|
|
|
|
$hardware = $data[1]['entPhysicalName'];
|
|
|
|
}
|
2015-07-13 20:10:26 +02:00
|
|
|
|
2016-12-16 16:38:14 +02:00
|
|
|
if (!empty($data[1]['entPhysicalModelName'])) {
|
|
|
|
$hardware = $data[1]['entPhysicalModelName'];
|
2012-03-20 23:56:40 +00:00
|
|
|
}
|
2011-03-15 11:59:47 +00:00
|
|
|
}
|
2017-03-21 16:11:42 +02:00
|
|
|
|
|
|
|
if (!empty($data[1000]['entPhysicalModelName'])) {
|
|
|
|
$hardware = $data[1000]['entPhysicalModelName'];
|
|
|
|
} elseif (!empty($data[1000]['entPhysicalContainedIn'])) {
|
|
|
|
$hardware = $data[$data[1000]['entPhysicalContainedIn']]['entPhysicalName'];
|
|
|
|
} elseif (!empty($data[1001]['entPhysicalModelName'])) {
|
2016-12-16 16:38:14 +02:00
|
|
|
$hardware = $data[1001]['entPhysicalModelName'];
|
|
|
|
} elseif (!empty($data[1001]['entPhysicalContainedIn'])) {
|
|
|
|
$hardware = $data[$data[1001]['entPhysicalContainedIn']]['entPhysicalName'];
|
|
|
|
}
|
2011-03-15 11:59:47 +00:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
if (empty($hardware)) {
|
|
|
|
$hardware = snmp_get($device, 'sysObjectID.0', '-Osqv', 'SNMPv2-MIB:CISCO-PRODUCTS-MIB');
|
|
|
|
}
|
2011-10-10 15:40:54 +00:00
|
|
|
|
2015-06-18 22:20:50 +01:00
|
|
|
$serial = get_main_serial($device);
|
2016-04-19 13:58:38 +02:00
|
|
|
|
|
|
|
if (strstr($hardware, 'cisco819')) {
|
2016-12-16 16:38:14 +02:00
|
|
|
include 'includes/polling/wireless/cisco-wwan.inc.php';
|
2016-04-19 13:58:38 +02:00
|
|
|
}
|