commit version 22.12.12447
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
@ -7,7 +6,7 @@
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage poller
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
@ -16,7 +15,10 @@
|
||||
// ALVARION-DOT11-WLAN-MIB::brzaccVLUnitType.0 = INTEGER: auSA(2)
|
||||
// ALVARION-DOT11-WLAN-TST-MIB::brzLighteOemProjectNameString.0 = STRING: "BreezeACCESS VL"
|
||||
|
||||
$unit_type = snmp_get($device, 'brzaccVLUnitType.0', '-OQv', 'ALVARION-DOT11-WLAN-MIB');
|
||||
$features = rewrite_breeze_type($unit_type);
|
||||
if ($unit_type = snmp_get_oid($device, 'brzaccVLUnitType.0', 'ALVARION-DOT11-WLAN-MIB')) {
|
||||
$features = rewrite_breeze_type($unit_type);
|
||||
}
|
||||
|
||||
unset($unit_type);
|
||||
|
||||
// EOF
|
||||
|
@ -6,16 +6,15 @@
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage poller
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
if (is_device_mib($device, 'CISCO-CONFIG-MAN-MIB'))
|
||||
{
|
||||
if (is_device_mib($device, 'CISCO-CONFIG-MAN-MIB')) {
|
||||
// Check Cisco configuration age
|
||||
|
||||
$oids = 'sysUpTime.0 ccmHistoryRunningLastChanged.0 ccmHistoryRunningLastSaved.0 ccmHistoryStartupLastChanged.0';
|
||||
$data = snmp_get_multi_oid($device, $oids, array(), 'SNMPv2-MIB:CISCO-CONFIG-MAN-MIB', NULL, OBS_SNMP_ALL_TIMETICKS);
|
||||
$data = snmp_get_multi_oid($device, $oids, [], 'SNMPv2-MIB:CISCO-CONFIG-MAN-MIB', NULL, OBS_SNMP_ALL_TIMETICKS);
|
||||
$config_age = $data[0];
|
||||
|
||||
foreach ($config_age as $key => $val)
|
||||
@ -42,102 +41,92 @@ if (is_device_mib($device, 'CISCO-CONFIG-MAN-MIB'))
|
||||
|
||||
$sysDescr = preg_replace('/\s+/', ' ', $poll_device['sysDescr']); // Replace all spaces and newline to single space
|
||||
// Generic IOS/IOS-XE/IES/IOS-XR sysDescr
|
||||
if (preg_match('/^Cisco IOS Software(?: \[\S+?\])?, .+? Software \((?:[^\-]+-(\w+)-\w|\w+_IOSXE)\),.+?Version ([^,\s]+)/', $sysDescr, $matches))
|
||||
{
|
||||
//Cisco IOS Software, Catalyst 4500 L3 Switch Software (cat4500e-ENTSERVICESK9-M), Version 15.2(1)E3, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2014 by Cisco Systems, Inc. Compiled Mon 05-May-14 07:56 b
|
||||
//Cisco IOS Software, IOS-XE Software (PPC_LINUX_IOSD-IPBASEK9-M), Version 15.2(2)S, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2012 by Cisco Systems, Inc. Compiled Mon 26-Mar-12 15:23 by mcpre
|
||||
//Cisco IOS Software, IES Software (IES-LANBASEK9-M), Version 12.2(52)SE1, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2010 by Cisco Systems, Inc. Compiled Tue 09-Feb-10 03:17 by prod_rel_team
|
||||
//Cisco IOS Software [Gibraltar], Catalyst L3 Switch Software (CAT9K_IOSXE), Version 16.11.1, RELEASE SOFTWARE (fc3) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2019 by Cisco Systems, Inc. Compiled Thu 28-Mar-19 09:42 by mcpre
|
||||
//Cisco IOS Software [Fuji], Catalyst L3 Switch Software (CAT9K_IOSXE), Version 16.8.1a, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2018 by Cisco Systems, Inc. Compiled Tue 03-Apr-18 18:49 by mcpre
|
||||
$features = $matches[1];
|
||||
$version = $matches[2];
|
||||
}
|
||||
elseif (preg_match('/^Cisco Internetwork Operating System Software IOS \(tm\) [^ ]+ Software \([^\-]+-(\w+)-\w\),.+?Version ([^, ]+)/', $sysDescr, $matches))
|
||||
{
|
||||
//Cisco Internetwork Operating System Software IOS (tm) 7200 Software (UBR7200-IK8SU2-M), Version 12.3(17b)BC8, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2007 by cisco Systems, Inc. Compiled Fri 29-Ju
|
||||
//Cisco Internetwork Operating System Software IOS (tm) C1700 Software (C1700-Y-M), Version 12.2(4)YA2, EARLY DEPLOYMENT RELEASE SOFTWARE (fc1) Synched to technology version 12.2(5.4)T TAC Support: http://www.cisco.com/tac Copyright (c) 1986-2002 by ci
|
||||
$features = $matches[1];
|
||||
$version = $matches[2];
|
||||
}
|
||||
elseif (preg_match('/^Cisco IOS XR Software \(Cisco ([^\)]+)\), Version ([^\[]+)\[([^\]]+)\]/', $sysDescr, $matches))
|
||||
{
|
||||
//Cisco IOS XR Software (Cisco 12816/PRP), Version 4.3.2[Default] Copyright (c) 2014 by Cisco Systems, Inc.
|
||||
//Cisco IOS XR Software (Cisco 12404/PRP), Version 3.6.0[00] Copyright (c) 2007 by Cisco Systems, Inc.
|
||||
//Cisco IOS XR Software (Cisco ASR9K Series), Version 5.1.2[Default] Copyright (c) 2014 by Cisco Systems, Inc.
|
||||
//$hardware = $matches[1];
|
||||
$features = $matches[3];
|
||||
$version = $matches[2];
|
||||
}
|
||||
elseif (preg_match('/^Cisco NX-OS(?:\(tm\))? (?<hw1>\S+?), Software \((?<hw2>.+?)\),.+?Version (?<version>[^, ]+)/', $sysDescr, $matches))
|
||||
{
|
||||
//Cisco NX-OS(tm) n7000, Software (n7000-s2-dk9), Version 6.2(8b), RELEASE SOFTWARE Copyright (c) 2002-2013 by Cisco Systems, Inc.
|
||||
//Cisco NX-OS(tm) n1000v, Software (n1000v-dk9), Version 5.2(1)SV3(1.2), RELEASE SOFTWARE Copyright (c) 2002-2011 by Cisco Systems, Inc. Device Manager Version nms.sro not found, Compiled 11/11/2014 15:00:00
|
||||
//Cisco NX-OS(tm) n5000, Software (n5000-uk9), Version 6.0(2)N2(7), RELEASE SOFTWARE Copyright (c) 2002-2012 by Cisco Systems, Inc. Device Manager Version 6.2(1), Compiled 4/28/2015 5:00:00
|
||||
//Cisco NX-OS(tm) n7000, Software (n7000-s2-dk9), Version 6.2(8a), RELEASE SOFTWARE Copyright (c) 2002-2013 by Cisco Systems, Inc. Compiled 5/15/2014 20:00:00
|
||||
//Cisco NX-OS(tm) n3000, Software (n3000-uk9), Version 6.0(2)U2(2), RELEASE SOFTWARE Copyright (c) 2002-2012 by Cisco Systems, Inc. Device Manager Version nms.sro not found, Compiled 2/12/2014 8:00:00
|
||||
//Cisco NX-OS(tm) ucs, Software (ucs-6100-k9-system), Version 5.0(3)N2(3.13a), RELEASE SOFTWARE Copyright (c) 2002-2013 by Cisco Systems, Inc. Compiled 4/25/2017 7:00:00
|
||||
//Cisco NX-OS(tm) aci, Software (aci-n9000-system), Version 12.0(1q), RELEASE SOFTWARE Copyright (c) 2002-2015 by Cisco Systems, Inc. Compiled 2016/08/18 14:20:16
|
||||
//Cisco NX-OS(tm) nxos.9.2.3.bin, Software (nxos), Version 9.2(3), RELEASE SOFTWARE Copyright (c) 2002-2019 by Cisco Systems, Inc. Compiled 2/17/2019 4:00:00
|
||||
//Cisco NX-OS n6000, Software (n6000-uk9), Version 7.3(2)N1(1), RELEASE SOFTWARE Copyright (c) 2002-2012, 2016-2017 by Cisco Systems, Inc. Device Manager Version 6.0(2)N1(1),Compiled 5/12/2017 23:00:00
|
||||
list(, $features) = explode('-', $matches['hw2'], 2);
|
||||
$version = $matches['version'];
|
||||
}
|
||||
elseif (preg_match('/Software \(\w+-(?<features>\w+)-\w\),.+?Version (?<version>[^, ]+),(?:[\w ]+)? RELEASE SOFTWARE/', $sysDescr, $matches))
|
||||
{
|
||||
//C800 Software (C800-UNIVERSALK9-M), Version 15.2(2)T2, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Compiled Thu 02-Aug-12 02:09 by prod_rel_team
|
||||
//Cisco IOS Software, Catalyst 4500 L3 Switch Software (cat4500e-ENTSERVICESK9-M), Version 15.2(1)E3, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2014 by Cisco Systems, Inc. Compiled Mon 05-May-14 07:56 b
|
||||
//Cisco IOS Software, ASR900 Software (PPC_LINUX_IOSD-UNIVERSALK9_NPE-M), Version 15.5(1)S, RELEASE SOFTWARE (fc5) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2014 by Cisco Systems, Inc. Compiled Thu 20-Nov-14 18:16 by mcpre
|
||||
//Cisco IOS Software, IOS-XE Software (PPC_LINUX_IOSD-IPBASEK9-M), Version 15.2(2)S, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2012 by Cisco Systems, Inc. Compiled Mon 26-Mar-12 15:23 by mcpre
|
||||
//Cisco IOS Software, IES Software (IES-LANBASEK9-M), Version 12.2(52)SE1, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2010 by Cisco Systems, Inc. Compiled Tue 09-Feb-10 03:17 by prod_rel_team
|
||||
|
||||
//Cisco Internetwork Operating System Software IOS (tm) 7200 Software (UBR7200-IK8SU2-M), Version 12.3(17b)BC8, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2007 by cisco Systems, Inc. Compiled Fri 29-Ju
|
||||
//Cisco Internetwork Operating System Software IOS (tm) C1700 Software (C1700-Y-M), Version 12.2(4)YA2, EARLY DEPLOYMENT RELEASE SOFTWARE (fc1) Synched to technology version 12.2(5.4)T TAC Support: http://www.cisco.com/tac Copyright (c) 1986-2002 by ci
|
||||
if (preg_match('/^Cisco IOS Software(?: \[\S+?\])?, .+? Software \((?:[^\-]+\-(?<features>\w+)\-\w|\w+_IOSXE(?:\-\w+)?)\),.+?Version (?<version>[^,\s]+)/', $sysDescr, $matches)) {
|
||||
// Cisco IOS Software, Catalyst 4500 L3 Switch Software (cat4500e-ENTSERVICESK9-M), Version 15.2(1)E3, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2014 by Cisco Systems, Inc. Compiled Mon 05-May-14 07:56 b
|
||||
// Cisco IOS Software, IOS-XE Software (PPC_LINUX_IOSD-IPBASEK9-M), Version 15.2(2)S, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2012 by Cisco Systems, Inc. Compiled Mon 26-Mar-12 15:23 by mcpre
|
||||
// Cisco IOS Software, IES Software (IES-LANBASEK9-M), Version 12.2(52)SE1, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2010 by Cisco Systems, Inc. Compiled Tue 09-Feb-10 03:17 by prod_rel_team
|
||||
// Cisco IOS Software [Gibraltar], Catalyst L3 Switch Software (CAT9K_IOSXE), Version 16.11.1, RELEASE SOFTWARE (fc3) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2019 by Cisco Systems, Inc. Compiled Thu 28-Mar-19 09:42 by mcpre
|
||||
// Cisco IOS Software [Fuji], Catalyst L3 Switch Software (CAT9K_IOSXE), Version 16.8.1a, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2018 by Cisco Systems, Inc. Compiled Tue 03-Apr-18 18:49 by mcpre
|
||||
// Cisco IOS Software [Amsterdam], C9800 Software (C9800_IOSXE-K9), Version 17.3.5a, RELEASE SOFTWARE (fc2) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2022 by Cisco Systems, Inc. Compiled Mon 28-Feb-22 19:09 by mcpre
|
||||
|
||||
$features = $matches['features'];
|
||||
$version = $matches['version'];
|
||||
}
|
||||
elseif (preg_match('/Software, Version (?<version>\d[\d\.\(\)]+)/', $sysDescr, $matches))
|
||||
{
|
||||
//Cisco Systems WS-C6509-E Cisco Catalyst Operating System Software, Version 8.4(3) Copyright (c) 1995-2005 by Cisco Systems
|
||||
//Cisco Systems, Inc. WS-C2948 Cisco Catalyst Operating System Software, Version 4.5(9) Copyright (c) 1995-2000 by Cisco Systems, Inc.
|
||||
//Cisco Systems, Inc. WS-C2948G-GE-TX Cisco Catalyst Operating System Software, Version 8.4(5)GLX Copyright (c) 1995-2005 by Cisco Systems, Inc.
|
||||
//Cisco Systems, Inc. WS-C4912 Cisco Catalyst Operating System Software, Version 7.2(2) Copyright (c) 1995-2002 by Cisco Systems, Inc.
|
||||
} elseif (preg_match('/^Cisco Internetwork Operating System Software IOS \(tm\) [^ ]+ Software \([^\-]+\-(?<features>\w+)\-\w\),.+?Version (?<version>[^, ]+)/', $sysDescr, $matches)) {
|
||||
// Cisco Internetwork Operating System Software IOS (tm) 7200 Software (UBR7200-IK8SU2-M), Version 12.3(17b)BC8, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2007 by cisco Systems, Inc. Compiled Fri 29-Ju
|
||||
// Cisco Internetwork Operating System Software IOS (tm) C1700 Software (C1700-Y-M), Version 12.2(4)YA2, EARLY DEPLOYMENT RELEASE SOFTWARE (fc1) Synched to technology version 12.2(5.4)T TAC Support: http://www.cisco.com/tac Copyright (c) 1986-2002 by ci
|
||||
|
||||
$features = $matches['features'];
|
||||
$version = $matches['version'];
|
||||
} elseif (preg_match('/^Cisco IOS XR Software \(Cisco (?<hardware>[^\)]+)\), Version (?<version>[^\[]+)\[(?<features>[^\]]+)\]/', $sysDescr, $matches)) {
|
||||
// Cisco IOS XR Software (Cisco 12816/PRP), Version 4.3.2[Default] Copyright (c) 2014 by Cisco Systems, Inc.
|
||||
// Cisco IOS XR Software (Cisco 12404/PRP), Version 3.6.0[00] Copyright (c) 2007 by Cisco Systems, Inc.
|
||||
// Cisco IOS XR Software (Cisco ASR9K Series), Version 5.1.2[Default] Copyright (c) 2014 by Cisco Systems, Inc.
|
||||
|
||||
//$hardware = $matches['hardware'];
|
||||
$features = $matches['features'];
|
||||
$version = $matches['version'];
|
||||
} elseif (preg_match('/^Cisco NX-OS(?:\(tm\))? (?<hw1>\S+?)( (?<hardware>[\w\-]+) chassis)?, Software \((?<hw2>.+?)\),.+?Version (?<version>[^, ]+)/', $sysDescr, $matches)) {
|
||||
// Cisco NX-OS(tm) n7000, Software (n7000-s2-dk9), Version 6.2(8b), RELEASE SOFTWARE Copyright (c) 2002-2013 by Cisco Systems, Inc.
|
||||
// Cisco NX-OS(tm) n1000v, Software (n1000v-dk9), Version 5.2(1)SV3(1.2), RELEASE SOFTWARE Copyright (c) 2002-2011 by Cisco Systems, Inc. Device Manager Version nms.sro not found, Compiled 11/11/2014 15:00:00
|
||||
// Cisco NX-OS(tm) n5000, Software (n5000-uk9), Version 6.0(2)N2(7), RELEASE SOFTWARE Copyright (c) 2002-2012 by Cisco Systems, Inc. Device Manager Version 6.2(1), Compiled 4/28/2015 5:00:00
|
||||
// Cisco NX-OS(tm) n7000, Software (n7000-s2-dk9), Version 6.2(8a), RELEASE SOFTWARE Copyright (c) 2002-2013 by Cisco Systems, Inc. Compiled 5/15/2014 20:00:00
|
||||
// Cisco NX-OS(tm) n3000, Software (n3000-uk9), Version 6.0(2)U2(2), RELEASE SOFTWARE Copyright (c) 2002-2012 by Cisco Systems, Inc. Device Manager Version nms.sro not found, Compiled 2/12/2014 8:00:00
|
||||
// Cisco NX-OS(tm) ucs, Software (ucs-6100-k9-system), Version 5.0(3)N2(3.13a), RELEASE SOFTWARE Copyright (c) 2002-2013 by Cisco Systems, Inc. Compiled 4/25/2017 7:00:00
|
||||
// Cisco NX-OS(tm) aci, Software (aci-n9000-system), Version 12.0(1q), RELEASE SOFTWARE Copyright (c) 2002-2015 by Cisco Systems, Inc. Compiled 2016/08/18 14:20:16
|
||||
// Cisco NX-OS(tm) nxos.9.2.3.bin, Software (nxos), Version 9.2(3), RELEASE SOFTWARE Copyright (c) 2002-2019 by Cisco Systems, Inc. Compiled 2/17/2019 4:00:00
|
||||
// Cisco NX-OS n6000, Software (n6000-uk9), Version 7.3(2)N1(1), RELEASE SOFTWARE Copyright (c) 2002-2012, 2016-2017 by Cisco Systems, Inc. Device Manager Version 6.0(2)N1(1),Compiled 5/12/2017 23:00:00
|
||||
// Cisco NX-OS(tm) Nexus9000 C93180YC-EX chassis, Software (NXOS 32-bit), Version 9.3(9), RELEASE SOFTWARE Copyright (c) 2002-2022 by Cisco Systems, Inc. Compiled 2/4/2022 7:00:00
|
||||
|
||||
if (str_contains($matches['hw2'], ' ')) {
|
||||
// NXOS 32-bit -> 32-bit
|
||||
list(, $features) = explode(' ', $matches['hw2'], 2);
|
||||
} elseif (str_contains($matches['hw2'], '-')) {
|
||||
// n7000-s2-dk9 -> s2-dk9
|
||||
list(, $features) = explode('-', $matches['hw2'], 2);
|
||||
}
|
||||
$version = $matches['version'];
|
||||
} elseif (preg_match('/Software \(\w+-(?<features>\w+)-\w\),.+?Version (?<version>[^, ]+),(?:[\w ]+)? RELEASE SOFTWARE/', $sysDescr, $matches)) {
|
||||
// C800 Software (C800-UNIVERSALK9-M), Version 15.2(2)T2, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Compiled Thu 02-Aug-12 02:09 by prod_rel_team
|
||||
// Cisco IOS Software, Catalyst 4500 L3 Switch Software (cat4500e-ENTSERVICESK9-M), Version 15.2(1)E3, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2014 by Cisco Systems, Inc. Compiled Mon 05-May-14 07:56 b
|
||||
// Cisco IOS Software, ASR900 Software (PPC_LINUX_IOSD-UNIVERSALK9_NPE-M), Version 15.5(1)S, RELEASE SOFTWARE (fc5) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2014 by Cisco Systems, Inc. Compiled Thu 20-Nov-14 18:16 by mcpre
|
||||
// Cisco IOS Software, IOS-XE Software (PPC_LINUX_IOSD-IPBASEK9-M), Version 15.2(2)S, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2012 by Cisco Systems, Inc. Compiled Mon 26-Mar-12 15:23 by mcpre
|
||||
// Cisco IOS Software, IES Software (IES-LANBASEK9-M), Version 12.2(52)SE1, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2010 by Cisco Systems, Inc. Compiled Tue 09-Feb-10 03:17 by prod_rel_team
|
||||
|
||||
// Cisco Internetwork Operating System Software IOS (tm) 7200 Software (UBR7200-IK8SU2-M), Version 12.3(17b)BC8, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2007 by cisco Systems, Inc. Compiled Fri 29-Ju
|
||||
// Cisco Internetwork Operating System Software IOS (tm) C1700 Software (C1700-Y-M), Version 12.2(4)YA2, EARLY DEPLOYMENT RELEASE SOFTWARE (fc1) Synched to technology version 12.2(5.4)T TAC Support: http://www.cisco.com/tac Copyright (c) 1986-2002 by ci
|
||||
|
||||
$features = $matches['features'];
|
||||
$version = $matches['version'];
|
||||
} elseif (preg_match('/Software( \([\w\- ]+\))?, Version (?<version>\d[\w\.\(\)]+)/', $sysDescr, $matches)) {
|
||||
// Cisco Systems WS-C6509-E Cisco Catalyst Operating System Software, Version 8.4(3) Copyright (c) 1995-2005 by Cisco Systems
|
||||
// Cisco Systems, Inc. WS-C2948 Cisco Catalyst Operating System Software, Version 4.5(9) Copyright (c) 1995-2000 by Cisco Systems, Inc.
|
||||
// Cisco Systems, Inc. WS-C2948G-GE-TX Cisco Catalyst Operating System Software, Version 8.4(5)GLX Copyright (c) 1995-2005 by Cisco Systems, Inc.
|
||||
// Cisco Systems, Inc. WS-C4912 Cisco Catalyst Operating System Software, Version 7.2(2) Copyright (c) 1995-2002 by Cisco Systems, Inc.
|
||||
|
||||
//$features = $matches['features'];
|
||||
$version = $matches['version'];
|
||||
}
|
||||
|
||||
// All other Cisco devices
|
||||
if (is_array($entPhysical))
|
||||
{
|
||||
if (is_module_enabled($device, 'inventory', 'discovery'))
|
||||
{
|
||||
if ($entPhysical['entPhysicalClass'] === 'stack')
|
||||
{
|
||||
if (is_array($entPhysical)) {
|
||||
if (is_module_enabled($device, 'inventory', 'discovery')) {
|
||||
if ($entPhysical['entPhysicalClass'] === 'stack') {
|
||||
// If it's stacked device try get chassis instead
|
||||
$chassis = dbFetchRow('SELECT * FROM `entPhysical` WHERE `device_id` = ? AND `entPhysicalClass` = ? AND `entPhysicalContainedIn` = ? AND `deleted` IS NULL', array($device['device_id'], 'chassis', '1'));
|
||||
if ($chassis['entPhysicalModelName'])
|
||||
{
|
||||
if ($chassis['entPhysicalModelName']) {
|
||||
$entPhysical = $chassis;
|
||||
}
|
||||
}
|
||||
elseif (empty($entPhysical['entPhysicalModelName']) || $entPhysical['entPhysicalModelName'] === 'MIDPLANE')
|
||||
{
|
||||
} elseif ($entPhysical['entPhysicalModelName'] === 'MIDPLANE' || safe_empty($entPhysical['entPhysicalModelName'])) {
|
||||
// F.u. Cisco.. for some platforms (4948/4900M) they store correct model and version not in chassis
|
||||
$hw_module = dbFetchRow('SELECT * FROM `entPhysical` WHERE `device_id` = ? AND `entPhysicalClass` = ? AND `entPhysicalContainedIn` = ? AND `deleted` IS NULL', array($device['device_id'], 'module', '2'));
|
||||
if ($hw_module['entPhysicalModelName'])
|
||||
{
|
||||
if ($hw_module['entPhysicalModelName']) {
|
||||
$entPhysical = $hw_module;
|
||||
}
|
||||
}
|
||||
elseif (empty($entPhysical['entPhysicalSoftwareRev']))
|
||||
{
|
||||
} elseif (safe_empty($entPhysical['entPhysicalSoftwareRev'])) {
|
||||
// 720X, try again get correct serial/version
|
||||
$hw_module = dbFetchRow('SELECT * FROM `entPhysical` WHERE `device_id` = ? AND `entPhysicalClass` = ? AND `entPhysicalContainedIn` = ? AND `entPhysicalSerialNum` != ? AND `deleted` IS NULL', array($device['device_id'], 'module', '1', ''));
|
||||
if ($hw_module['entPhysicalSoftwareRev'])
|
||||
{
|
||||
if ($device['os'] === 'iosxe')
|
||||
{
|
||||
if ($hw_module['entPhysicalSoftwareRev']) {
|
||||
if ($device['os'] === 'iosxe') {
|
||||
// For IOS-XE fix only version
|
||||
$entPhysical['entPhysicalSoftwareRev'] = $hw_module['entPhysicalSoftwareRev'];
|
||||
} else {
|
||||
@ -147,14 +136,11 @@ if (is_array($entPhysical))
|
||||
}
|
||||
}
|
||||
|
||||
if (in_array($entPhysical['entPhysicalContainedIn'], [ '0', '1', '2' ]) || $entPhysical['entPhysicalClass'] === 'chassis')
|
||||
{
|
||||
if ((empty($version) || $device['os'] === 'iosxe') && !empty($entPhysical['entPhysicalSoftwareRev']))
|
||||
{
|
||||
if ($entPhysical['entPhysicalClass'] === 'chassis' || in_array($entPhysical['entPhysicalContainedIn'], [ '0', '1', '2' ])) {
|
||||
if ((safe_empty($version) || $device['os'] === 'iosxe') && !empty($entPhysical['entPhysicalSoftwareRev'])) {
|
||||
$version = $entPhysical['entPhysicalSoftwareRev'];
|
||||
}
|
||||
if (!empty($entPhysical['entPhysicalModelName']))
|
||||
{
|
||||
if (!empty($entPhysical['entPhysicalModelName'])) {
|
||||
if (preg_match('/ (rev|dev)/', $entPhysical['entPhysicalModelName']) || // entPhysicalModelName = "73-7036-1 rev 80 dev 0"
|
||||
preg_match('/^\.+$/', $entPhysical['entPhysicalModelName'])) // entPhysicalModelName = "..."
|
||||
{
|
||||
@ -167,8 +153,7 @@ if (is_array($entPhysical))
|
||||
} else {
|
||||
$hardware = str_replace(' chassis', '', $entPhysical['entPhysicalName']);
|
||||
}
|
||||
if (!empty($entPhysical['entPhysicalSerialNum']))
|
||||
{
|
||||
if (!empty($entPhysical['entPhysicalSerialNum'])) {
|
||||
$serial = $entPhysical['entPhysicalSerialNum'];
|
||||
}
|
||||
}
|
||||
@ -182,20 +167,17 @@ if (is_array($entPhysical))
|
||||
// entPhysicalModelName: WS-C2960-48TC-S
|
||||
// sysObjectID [.1.3.6.1.4.1.9.1.1208]: cat29xxStack
|
||||
// entPhysicalModelName: WS-C2960S-F48TS-L
|
||||
if (empty($hardware) && $poll_device['sysObjectID'])
|
||||
{
|
||||
if (empty($hardware) && $poll_device['sysObjectID']) {
|
||||
// Try translate instead duplicate get sysObjectID
|
||||
$hardware = snmp_translate($poll_device['sysObjectID'], 'SNMPv2-MIB:CISCO-PRODUCTS-MIB:CISCO-ENTITY-VENDORTYPE-OID-MIB');
|
||||
}
|
||||
if (empty($hardware))
|
||||
{
|
||||
if (empty($hardware)) {
|
||||
// If translate false, try get sysObjectID again
|
||||
$hardware = snmp_get_oid($device, 'sysObjectID.0', 'SNMPv2-MIB:CISCO-PRODUCTS-MIB:CISCO-ENTITY-VENDORTYPE-OID-MIB');
|
||||
}
|
||||
|
||||
// Some cisco specific hardware rewrites
|
||||
if ($hardware)
|
||||
{
|
||||
if ($hardware) {
|
||||
$cisco_replace = [
|
||||
'/^[Cc]isco\s*(\d)/' => '\1', // Cisco 7604 -> 7604
|
||||
'/^cisco([a-z])/i' => '\1', // ciscoASR9010 -> ASR9010
|
||||
|
@ -1,34 +1,52 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @package observium
|
||||
* @subpackage poller
|
||||
* @copyright (C) 2006-2015 Adam Armstrong
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
# PowerWalker/BlueWalker UPS (Tested with BlueWalked VFI 2000 LCD (EPPC-MIB) sysDescr.0 = STRING: Network Management Card for UPS
|
||||
if (str_contains($poll_device['sysDescr'], 'Network Management Card for UPS')) {
|
||||
// EPPC-MIB::upsEIdentityManufacturer.0 = STRING: EPPC
|
||||
// EPPC-MIB::upsEIdentityModel.0 = STRING: ON-LINE
|
||||
// EPPC-MIB::upsEIdentityUPSFirmwareVerison.0 = STRING: 06.00
|
||||
// EPPC-MIB::upsEIndentityUPSSerialNumber.0 = STRING:
|
||||
// EPPC-MIB::upsEIdentityDescription.0 = STRING:
|
||||
// EPPC-MIB::upsEIdentityAgentSoftwareVerison.0 = STRING: 3.0.0.2
|
||||
// EPPC-MIB::upsEIdentityAttachedDevices.0 = STRING:
|
||||
if ($data = snmp_get_multi_oid($device, 'upsEIdentityManufacturer.0 upsESystemConfigOutputVA.0 upsEIdentityModel.0', [], 'EPPC-MIB')) {
|
||||
if ($data[0]['upsEIdentityManufacturer'] === 'EPPC') {
|
||||
// FIXME. Not sure, see: https://jira.observium.org/browse/OBS-4314
|
||||
$vendor = 'Eaton';
|
||||
//} elseif ($data[0]['upsEIdentityManufacturer']) {
|
||||
// $vendor = $data[0]['upsEIdentityManufacturer'];
|
||||
} else {
|
||||
$vendor = 'PowerWalker';
|
||||
}
|
||||
|
||||
if ($poll_device['sysObjectID'] == '.1.3.6.1.4.1.935.10.1') // BlueWalker
|
||||
{
|
||||
if ($poll_device['sysDescr'] == 'Network Management Card for UPS')
|
||||
{
|
||||
$hardware = snmp_get($device, 'upsEIdentityManufacturer.0', '-OQv', 'EPPC-MIB') . ' (' .
|
||||
snmp_get($device, 'upsESystemConfigOutputVA.0', '-OQv', 'EPPC-MIB') . 'VA ' . snmp_get($device, 'upsEIdentityModel.0', '-OQv', 'EPPC-MIB') . ')';
|
||||
$upsEIdentityDescription = snmp_get($device, 'upsEIdentityDescription.0', '-OQv', 'EPPC-MIB');
|
||||
$version = $upsEIdentityDescription + ' UPS: ' .
|
||||
snmp_get($device, 'upsEIdentityUPSFirmwareVerison.0', '-OQv', 'EPPC-MIB') . ' Firmware: ' . snmp_get($device, 'upsIdentAgentSoftwareVersion.0', '-OQv', 'EPPC-MIB');
|
||||
$status = snmp_get($device, 'upsESystemStatus.0', '-OQv', 'EPPC-MIB') . ' ' . snmp_get($device, 'upsEBatteryTestResult.0', '-OQv', 'EPPC-MIB');
|
||||
$hardware = $data[0]['upsEIdentityModel'];
|
||||
if ($data[0]['upsESystemConfigOutputVA'] > 0) {
|
||||
$hardware .= '('.$data[0]['upsESystemConfigOutputVA'].'VA)';
|
||||
}
|
||||
|
||||
$features = 'Status: ' . strtoupper($status);
|
||||
}
|
||||
else {
|
||||
$hardware = 'EPPC - Unknown NMC Card';
|
||||
|
||||
if ($data = snmp_get_multi_oid($device, 'upsEIdentityDescription.0 upsEIdentityUPSFirmwareVerison.0 upsIdentAgentSoftwareVersion.0', [], 'EPPC-MIB')) {
|
||||
$version = $data[0]['upsEIdentityDescription'] . ' UPS: ' .
|
||||
$data[0]['upsEIdentityUPSFirmwareVerison'] . ' Firmware: ' . $data[0]['upsIdentAgentSoftwareVersion'];
|
||||
|
||||
}
|
||||
|
||||
//if ($data = snmp_get_multi_oid($device, 'upsESystemStatus.0 upsEBatteryTestResult.0', [], 'EPPC-MIB')) {
|
||||
// $features = 'Status: ' . strtoupper($data[0]['upsESystemStatus'] . ' ' . $data[0]['upsEBatteryTestResult']);
|
||||
//}
|
||||
} else {
|
||||
$hardware = 'EPPC - Unknown NMC Card';
|
||||
}
|
||||
|
||||
// EOF
|
||||
|
@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
@ -7,18 +6,19 @@
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage poller
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
if (!$hardware)
|
||||
{
|
||||
$hardware = rewrite_definition_hardware($device, $poll_device['sysObjectID']);
|
||||
if ($fn_hw = rewrite_definition_hardware($device, $poll_device['sysObjectID'])) {
|
||||
// Prefer defined hardware
|
||||
$hardware = $fn_hw;
|
||||
$fn_type = rewrite_definition_type($device, $poll_device['sysObjectID']);
|
||||
if (!empty($fn_type))
|
||||
{
|
||||
if (!empty($fn_type)) {
|
||||
$type = $fn_type;
|
||||
}
|
||||
} elseif (str_contains($hardware, 'WiFi')) {
|
||||
$type = 'wireless';
|
||||
}
|
||||
|
||||
// EOF
|
||||
|
@ -6,22 +6,20 @@
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage poller
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
switch ($device['os']) {
|
||||
case 'aix':
|
||||
list($hardware,,$os_detail,) = explode("\n", $poll_device['sysDescr']);
|
||||
if (preg_match('/: 0*(\d+\.)0*(\d+\.)0*(\d+\.)(\d+)/', $os_detail, $matches))
|
||||
{
|
||||
if (preg_match('/: 0*(\d+\.)0*(\d+\.)0*(\d+\.)(\d+)/', $os_detail, $matches)) {
|
||||
// Base Operating System Runtime AIX version: 05.03.0012.0001
|
||||
$version = $matches[1] . $matches[2] . $matches[3] . $matches[4];
|
||||
}
|
||||
|
||||
$hardware_model = snmp_get_oid($device, 'aixSeMachineType.0', 'IBM-AIX-MIB');
|
||||
if ($hardware_model)
|
||||
{
|
||||
if ($hardware_model) {
|
||||
list(,$hardware_model) = explode(',', $hardware_model);
|
||||
|
||||
$serial = snmp_get_oid($device, 'aixSeSerialNumber.0', 'IBM-AIX-MIB');
|
||||
@ -32,8 +30,9 @@ switch ($device['os']) {
|
||||
break;
|
||||
|
||||
case 'freebsd':
|
||||
preg_match('/FreeBSD ([\d\.]+\-[\w\-]+)/i', $poll_device['sysDescr'], $matches);
|
||||
$kernel = $matches[1];
|
||||
if (preg_match('/FreeBSD ([\d\.]+\-[\w\-]+)/i', $poll_device['sysDescr'], $matches)) {
|
||||
$kernel = $matches[1];
|
||||
}
|
||||
$hardware = rewrite_unix_hardware($poll_device['sysDescr']);
|
||||
break;
|
||||
|
||||
@ -58,7 +57,9 @@ switch ($device['os']) {
|
||||
|
||||
case 'monowall':
|
||||
case 'pfsense':
|
||||
list(,,$version,,, $kernel) = explode(' ', $poll_device['sysDescr']);
|
||||
if (safe_empty($kernel)) {
|
||||
list(, , $version, , , $kernel) = explode(' ', $poll_device['sysDescr']);
|
||||
}
|
||||
$distro = $device['os'];
|
||||
$hardware = rewrite_unix_hardware($poll_device['sysDescr']);
|
||||
break;
|
||||
@ -103,8 +104,7 @@ switch ($device['os']) {
|
||||
case 'ipso':
|
||||
// IPSO Bastion-1 6.2-GA039 releng 1 04.14.2010-225515 i386
|
||||
// IP530 rev 00, IPSO ruby.infinity-insurance.com 3.9-BUILD035 releng 1515 05.24.2005-013334 i386
|
||||
if (preg_match('/IPSO [^ ]+ ([^ ]+) /', $poll_device['sysDescr'], $matches))
|
||||
{
|
||||
if (preg_match('/IPSO [^ ]+ ([^ ]+) /', $poll_device['sysDescr'], $matches)) {
|
||||
$version = $matches[1];
|
||||
}
|
||||
|
||||
@ -121,8 +121,7 @@ switch ($device['os']) {
|
||||
// EMBEDDED-NGX-MIB::swLicenseProductName.0 = "Safe@Office 500, 25 nodes"
|
||||
// EMBEDDED-NGX-MIB::swFirmwareRunning.0 = "8.2.26x"
|
||||
$data = snmp_get_multi_oid($device, 'swHardwareVersion.0 swHardwareType.0 swLicenseProductName.0 swFirmwareRunning.0', array(), 'EMBEDDED-NGX-MIB');
|
||||
if (isset($data[0]))
|
||||
{
|
||||
if (isset($data[0])) {
|
||||
list($hw) = explode(',', $data[0]['swLicenseProductName']);
|
||||
$hardware = $hw . ' ' . $data[0]['swHardwareType'] . ' ' . $data[0]['swHardwareVersion'];
|
||||
$version = $data[0]['swFirmwareRunning'];
|
||||
@ -153,18 +152,13 @@ switch ($device['os']) {
|
||||
// zur: 3 first letter from the location / city name
|
||||
// acc: optional or sub-segment, like dns and mep
|
||||
// 1: Device number in the same clusters for High availability
|
||||
if (preg_match('/^Linux\ +\w+\-(?<hw>(?<hw1>[a-z]+)0*\d+)\-\w+\-\w+\-(?:(?<hw2>\w+)\-)?\d+/', $poll_device['sysDescr'], $matches))
|
||||
{
|
||||
switch ($matches['hw1'])
|
||||
{
|
||||
if (preg_match('/^Linux\ +\w+\-(?<hw>(?<hw1>[a-z]+)0*\d+)\-\w+\-\w+\-(?:(?<hw2>\w+)\-)?\d+/', $poll_device['sysDescr'], $matches)) {
|
||||
switch ($matches['hw1']) {
|
||||
case 'sg':
|
||||
if (isset($matches['hw2']) && $matches['hw2'] === 'dns')
|
||||
{
|
||||
if (isset($matches['hw2']) && $matches['hw2'] === 'dns') {
|
||||
$hw = 'DNS Server';
|
||||
$type = 'server';
|
||||
}
|
||||
elseif (isset($matches['hw2']) && $matches['hw2'] === 'mep')
|
||||
{
|
||||
} elseif (isset($matches['hw2']) && $matches['hw2'] === 'mep') {
|
||||
$hw = 'Mobile Entry Point';
|
||||
$type = 'network';
|
||||
} else {
|
||||
@ -240,14 +234,18 @@ switch ($device['os']) {
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($hw))
|
||||
{
|
||||
if (empty($hw)) {
|
||||
$hw = 'OSAG Hardware';
|
||||
}
|
||||
//$hardware = $hw . ' (' . strtoupper($matches['hw']) . ')';
|
||||
$hardware = rewrite_unix_hardware($poll_device['sysDescr'], $hw);
|
||||
break;
|
||||
|
||||
case 'unitrends-backup':
|
||||
// Prevent Distro/kernel/packages polling
|
||||
// But keep other unix group features
|
||||
return;
|
||||
|
||||
// case 'linux':
|
||||
// case 'endian':
|
||||
// case 'ddwrt':
|
||||
@ -345,148 +343,146 @@ if (isset($agent_data['distro']) && isset($agent_data['distro']['SCRIPTVER'])) {
|
||||
}
|
||||
|
||||
// Detect some distro by kernel strings
|
||||
if (!isset($distro) && $poll_device['sysObjectID'] === '.1.3.6.1.4.1.8072.3.2.10' &&
|
||||
str_starts($poll_device['sysDescr'], 'Linux ')) {
|
||||
// * Ubuntu (old):
|
||||
// Linux hostname 3.11.0-13-generic #20-Ubuntu SMP Wed Oct 23 07:38:26 UTC 2013 x86_64
|
||||
// * Ubuntu 16.04:
|
||||
// Linux hostname 4.4.0-77-generic #98-Ubuntu SMP Wed Apr 26 08:34:02 UTC 2017 x86_64
|
||||
// Linux hostname 4.4.0-201-generic #233-Ubuntu SMP Thu Jan 14 06:10:28 UTC 2021 x86_64
|
||||
// * Ubuntu 18.04:
|
||||
// Linux hostname 4.15.0-96-generic #97-Ubuntu SMP Wed Apr 1 03:25:46 UTC 2020 x86_64
|
||||
// Linux hostname 4.15.0-129-generic #132-Ubuntu SMP Thu Dec 10 14:02:26 UTC 2020 x86_64
|
||||
// * Ubuntu 20.04
|
||||
// Linux hostname 5.10.4-051004-generic #202012301142 SMP Wed Dec 30 11:44:55 UTC 2020 x86_64
|
||||
// Linux hostname 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64
|
||||
if (preg_match('/ \d[\.\d]+(\-\d+)?(\-[a-z]+)? #(\d+\-Ubuntu|\d{12}) /', $poll_device['sysDescr'])) {
|
||||
$distro = 'Ubuntu';
|
||||
}
|
||||
// * Debian 9
|
||||
// Linux hostname 4.9.0-6-amd64 #1 SMP Debian 4.9.88-1+deb9u1 (2018-05-07) x86_64
|
||||
// Linux hostname 4.9.0-14-amd64 #1 SMP Debian 4.9.240-2 (2020-10-30) x86_64
|
||||
elseif (preg_match('/ Debian \d[\.\d]+(\-\d+)?([\+\-]\w+)? /', $poll_device['sysDescr'])) {
|
||||
$distro = 'Debian';
|
||||
}
|
||||
// * Proxmox (Debian)
|
||||
// Linux hostname 5.11.22-2-pve #1 SMP PVE 5.11.22-4 (Tue, 20 Jul 2021 21:40:02 +0200) x86_64
|
||||
// Linux hostname 5.4.78-2-pve #1 SMP PVE 5.4.78-2 (Thu, 03 Dec 2020 14:26:17 +0100) x86_64
|
||||
// Linux hostname 5.4.44-1-pve #1 SMP PVE 5.4.44-1 (Fri, 12 Jun 2020 08:18:46 +0200) x86_64
|
||||
// Linux hostname 5.0.21-5-pve #1 SMP PVE 5.0.21-10 (Wed, 13 Nov 2019 08:27:10 +0100) x86_64
|
||||
// Linux hostname 4.4.128-1-pve #1 SMP PVE 4.4.128-111 (Wed, 23 May 2018 14:00:02 +0000) x86_64
|
||||
// Linux hostname 4.4.8-1-pve #1 SMP Tue May 31 07:12:32 CEST 2016 x86_64
|
||||
elseif (preg_match('/\d\-pve | PVE /', $poll_device['sysDescr'])) {
|
||||
$distro = 'Debian';
|
||||
}
|
||||
// * Raspbian (Debian)
|
||||
// Linux hostname 5.10.17-v7+ #1403 SMP Mon Feb 22 11:29:51 GMT 2021 armv7l
|
||||
// Linux hostname 5.4.51-v7l+ #1333 SMP Mon Aug 10 16:51:40 BST 2020 armv7l
|
||||
// Linux hostname 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l
|
||||
// Linux hostname 4.14.43+ #1115 Fri May 25 13:54:20 BST 2018 armv6l
|
||||
// Linux hostname 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l
|
||||
// Linux hostname 3.12.33+ #724 PREEMPT Wed Nov 26 17:55:23 GMT 2014 armv6l
|
||||
elseif (preg_match('/ \d[\.\d]+(\-v\d+\w*)?\+ #\d+ .* arm/', $poll_device['sysDescr'])) {
|
||||
$distro = 'Raspbian';
|
||||
}
|
||||
// * Armbian (Ubuntu)
|
||||
// Linux hostname 5.10.60-sunxi #21.08.2 SMP Tue Sep 14 16:28:44 UTC 2021 armv7l
|
||||
elseif (preg_match('/^Linux \S+ \d\S+\d+(\-\w+)?\-sunxi #(?<distro_ver>\d+\.\d+(\.\d+)?) .* arm/', $poll_device['sysDescr'], $matches)) {
|
||||
$distro = 'Armbian';
|
||||
$distro_ver = $matches['distro_ver'];
|
||||
}
|
||||
// * Arch Linux
|
||||
// Linux hostname 2.6.37-ARCH #1 SMP PREEMPT Sat Jan 29 20:00:33 CET 2011 x86_64
|
||||
// Linux hostname 4.19.86-1-ARCH #1 SMP PREEMPT Sat Nov 30 18:56:30 UTC 2019 armv6l
|
||||
// Linux hostname 5.10.27-2-ARCH #1 SMP Fri Apr 9 21:08:37 UTC 2021 armv6l
|
||||
// Linux hostname 5.10.79-2-raspberrypi-ARCH #1 SMP Tue Nov 16 20:32:00 UTC 2021 armv6l GNU/Linux
|
||||
elseif (preg_match('/^Linux \S+ \d\S+\d+(\-\w+)?\-ARCH #\d/', $poll_device['sysDescr'])) {
|
||||
$distro = 'Arch Linux';
|
||||
}
|
||||
// * CentOS 5:
|
||||
// Linux hostname 2.6.18-274.12.1.el5 #1 SMP Tue Nov 29 13:37:46 EST 2011 x86_64
|
||||
// * OracleLinux 6:
|
||||
// Linux hostname 2.6.32-131.0.15.el6.x86_64 #1 SMP Fri May 20 15:04:03 EDT 2011 x86_64
|
||||
// * CentOS 7:
|
||||
// Linux hostname 3.10.0-327.4.5.el7.x86_64 #1 SMP Mon Jan 25 22:07:14 UTC 2016 x86_64
|
||||
// * RedHat EL:
|
||||
// Linux hostname 3.10.0-327.el7.x86_64 #1 SMP Thu Oct 29 17:29:29 EDT 2015 x86_64
|
||||
// Linux hostname 3.10.0-229.20.1.el7.x86_64 #1 SMP Thu Sep 24 12:23:56 EDT 2015 x86_64
|
||||
// Linux hostname 4.18.0-240.22.1.el8_3.x86_64 #1 SMP Thu Mar 25 14:36:04 EDT 2021 x86_64
|
||||
elseif (preg_match('/ \d[\.\d]+(\-\d+[\.\d]*\.el(?<distro_ver>\d+(_\d+)?))/', $poll_device['sysDescr'], $matches)) {
|
||||
// Detect distro by packages
|
||||
$distro_def = [
|
||||
// redhat-release-server-6Server-6.7.0.3.el6
|
||||
// redhat-release-8.3-1.0.el8
|
||||
[ 'name' => 'redhat-release', 'regex' => '/^redhat\-release[\-_](?<version>\d.*)/', 'distro' => 'RedHat',
|
||||
'transform' => [ [ 'action' => 'preg_replace', 'from' => '/^(\d+[\.\-]\d+).*/', 'to' => '$1' ],
|
||||
[ 'action' => 'replace', 'from' => '-', 'to' => '.' ] ] ],
|
||||
// centos-release-6-3.el6.centos.9
|
||||
// centos-release-6-9.el6.12.3
|
||||
// centos-release-7-6.1810.2.el7.centos
|
||||
[ 'name' => 'centos-release', 'regex' => '/^centos\-release[\-_](?<version>\d.*)/', 'distro' => 'CentOS',
|
||||
'transform' => [ [ 'action' => 'preg_replace', 'from' => '/^(\d+[\.\-]\d+).*/', 'to' => '$1' ],
|
||||
[ 'action' => 'replace', 'from' => '-', 'to' => '.' ] ] ],
|
||||
// rocky-release-8.5-3.el8
|
||||
[ 'name' => 'rocky-release', 'regex' => '/^rocky\-release[\-_](?<version>\d.*)/', 'distro' => 'Rocky',
|
||||
'transform' => [ [ 'action' => 'preg_replace', 'from' => '/^(\d+[\.\-]\d+).*/', 'to' => '$1' ],
|
||||
[ 'action' => 'replace', 'from' => '-', 'to' => '.' ] ] ],
|
||||
// oraclelinux-release-6Server-1.0.2
|
||||
// fixme. need more examples
|
||||
];
|
||||
$metatypes = [ 'distro', 'distro_ver' ];
|
||||
foreach (poll_device_unix_packages($device, $metatypes, $distro_def) as $metatype => $value) {
|
||||
$$metatype = $value;
|
||||
if (!isset($distro)) {
|
||||
if ($poll_device['sysObjectID'] === '.1.3.6.1.4.1.8072.3.2.10' && str_starts($poll_device['sysDescr'], 'Linux ')) {
|
||||
// * Ubuntu (old):
|
||||
// Linux hostname 3.11.0-13-generic #20-Ubuntu SMP Wed Oct 23 07:38:26 UTC 2013 x86_64
|
||||
// * Ubuntu 16.04:
|
||||
// Linux hostname 4.4.0-77-generic #98-Ubuntu SMP Wed Apr 26 08:34:02 UTC 2017 x86_64
|
||||
// Linux hostname 4.4.0-201-generic #233-Ubuntu SMP Thu Jan 14 06:10:28 UTC 2021 x86_64
|
||||
// * Ubuntu 18.04:
|
||||
// Linux hostname 4.15.0-96-generic #97-Ubuntu SMP Wed Apr 1 03:25:46 UTC 2020 x86_64
|
||||
// Linux hostname 4.15.0-129-generic #132-Ubuntu SMP Thu Dec 10 14:02:26 UTC 2020 x86_64
|
||||
// * Ubuntu 20.04
|
||||
// Linux hostname 5.10.4-051004-generic #202012301142 SMP Wed Dec 30 11:44:55 UTC 2020 x86_64
|
||||
// Linux hostname 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64
|
||||
if (preg_match('/ \d[\.\d]+(\-\d+)?(\-[a-z]+)? #(\d+\-Ubuntu|\d{12}) /', $poll_device['sysDescr'])) {
|
||||
$distro = 'Ubuntu';
|
||||
}
|
||||
if (safe_empty($distro)) {
|
||||
// there no way for split RedHat vs CentOS..
|
||||
//$distro = 'CentOS';
|
||||
$distro = 'RedHat'; // FIXME. no way for correctly detect redhat or centos, probably by packages?..
|
||||
$distro_ver = str_replace('_', '.', $matches['distro_ver']);
|
||||
// * Debian 9
|
||||
// Linux hostname 4.9.0-6-amd64 #1 SMP Debian 4.9.88-1+deb9u1 (2018-05-07) x86_64
|
||||
// Linux hostname 4.9.0-14-amd64 #1 SMP Debian 4.9.240-2 (2020-10-30) x86_64
|
||||
elseif (preg_match('/ Debian \d[\.\d]+(\-\d+)?([\+\-]\w+)? /', $poll_device['sysDescr'])) {
|
||||
$distro = 'Debian';
|
||||
}
|
||||
// * Proxmox (Debian)
|
||||
// Linux hostname 5.11.22-2-pve #1 SMP PVE 5.11.22-4 (Tue, 20 Jul 2021 21:40:02 +0200) x86_64
|
||||
// Linux hostname 5.4.78-2-pve #1 SMP PVE 5.4.78-2 (Thu, 03 Dec 2020 14:26:17 +0100) x86_64
|
||||
// Linux hostname 5.4.44-1-pve #1 SMP PVE 5.4.44-1 (Fri, 12 Jun 2020 08:18:46 +0200) x86_64
|
||||
// Linux hostname 5.0.21-5-pve #1 SMP PVE 5.0.21-10 (Wed, 13 Nov 2019 08:27:10 +0100) x86_64
|
||||
// Linux hostname 4.4.128-1-pve #1 SMP PVE 4.4.128-111 (Wed, 23 May 2018 14:00:02 +0000) x86_64
|
||||
// Linux hostname 4.4.8-1-pve #1 SMP Tue May 31 07:12:32 CEST 2016 x86_64
|
||||
elseif (preg_match('/\d\-pve | PVE /', $poll_device['sysDescr'])) {
|
||||
$distro = 'Debian';
|
||||
}
|
||||
// * Raspbian (Debian)
|
||||
// Linux hostname 5.10.17-v7+ #1403 SMP Mon Feb 22 11:29:51 GMT 2021 armv7l
|
||||
// Linux hostname 5.4.51-v7l+ #1333 SMP Mon Aug 10 16:51:40 BST 2020 armv7l
|
||||
// Linux hostname 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l
|
||||
// Linux hostname 4.14.43+ #1115 Fri May 25 13:54:20 BST 2018 armv6l
|
||||
// Linux hostname 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l
|
||||
// Linux hostname 3.12.33+ #724 PREEMPT Wed Nov 26 17:55:23 GMT 2014 armv6l
|
||||
elseif (preg_match('/ \d[\.\d]+(\-v\d+\w*)?\+ #\d+ .* arm/', $poll_device['sysDescr'])) {
|
||||
$distro = 'Raspbian';
|
||||
}
|
||||
// * Armbian (Ubuntu)
|
||||
// Linux hostname 5.10.60-sunxi #21.08.2 SMP Tue Sep 14 16:28:44 UTC 2021 armv7l
|
||||
elseif (preg_match('/^Linux \S+ \d\S+\d+(\-\w+)?\-sunxi #(?<distro_ver>\d+\.\d+(\.\d+)?) .* arm/', $poll_device['sysDescr'], $matches)) {
|
||||
$distro = 'Armbian';
|
||||
$distro_ver = $matches['distro_ver'];
|
||||
}
|
||||
// * Arch Linux
|
||||
// Linux hostname 2.6.37-ARCH #1 SMP PREEMPT Sat Jan 29 20:00:33 CET 2011 x86_64
|
||||
// Linux hostname 4.19.86-1-ARCH #1 SMP PREEMPT Sat Nov 30 18:56:30 UTC 2019 armv6l
|
||||
// Linux hostname 5.10.27-2-ARCH #1 SMP Fri Apr 9 21:08:37 UTC 2021 armv6l
|
||||
// Linux hostname 5.10.79-2-raspberrypi-ARCH #1 SMP Tue Nov 16 20:32:00 UTC 2021 armv6l GNU/Linux
|
||||
elseif (preg_match('/^Linux \S+ \d\S+\d+(\-\w+)?\-ARCH #\d/', $poll_device['sysDescr'])) {
|
||||
$distro = 'Arch Linux';
|
||||
}
|
||||
// * CentOS 5:
|
||||
// Linux hostname 2.6.18-274.12.1.el5 #1 SMP Tue Nov 29 13:37:46 EST 2011 x86_64
|
||||
// * OracleLinux 6:
|
||||
// Linux hostname 2.6.32-131.0.15.el6.x86_64 #1 SMP Fri May 20 15:04:03 EDT 2011 x86_64
|
||||
// * CentOS 7:
|
||||
// Linux hostname 3.10.0-327.4.5.el7.x86_64 #1 SMP Mon Jan 25 22:07:14 UTC 2016 x86_64
|
||||
// * RedHat EL:
|
||||
// Linux hostname 3.10.0-327.el7.x86_64 #1 SMP Thu Oct 29 17:29:29 EDT 2015 x86_64
|
||||
// Linux hostname 3.10.0-229.20.1.el7.x86_64 #1 SMP Thu Sep 24 12:23:56 EDT 2015 x86_64
|
||||
// Linux hostname 4.18.0-240.22.1.el8_3.x86_64 #1 SMP Thu Mar 25 14:36:04 EDT 2021 x86_64
|
||||
elseif (preg_match('/ \d[\.\d]+(\-\d+[\.\d]*\.el(?<distro_ver>\d+(_\d+)?))/', $poll_device['sysDescr'], $matches)) {
|
||||
// Detect distro by packages
|
||||
$distro_def = [
|
||||
// redhat-release-server-6Server-6.7.0.3.el6
|
||||
// redhat-release-8.3-1.0.el8
|
||||
[ 'name' => 'redhat-release', 'regex' => '/^redhat\-release[\-_](?<version>\d.*)/', 'distro' => 'RedHat',
|
||||
'transform' => [ [ 'action' => 'preg_replace', 'from' => '/^(\d+[\.\-]\d+).*/', 'to' => '$1' ],
|
||||
[ 'action' => 'replace', 'from' => '-', 'to' => '.' ] ] ],
|
||||
// centos-release-6-3.el6.centos.9
|
||||
// centos-release-6-9.el6.12.3
|
||||
// centos-release-7-6.1810.2.el7.centos
|
||||
[ 'name' => 'centos-release', 'regex' => '/^centos\-release[\-_](?<version>\d.*)/', 'distro' => 'CentOS',
|
||||
'transform' => [ [ 'action' => 'preg_replace', 'from' => '/^(\d+[\.\-]\d+).*/', 'to' => '$1' ],
|
||||
[ 'action' => 'replace', 'from' => '-', 'to' => '.' ] ] ],
|
||||
// rocky-release-8.5-3.el8
|
||||
[ 'name' => 'rocky-release', 'regex' => '/^rocky\-release[\-_](?<version>\d.*)/', 'distro' => 'Rocky',
|
||||
'transform' => [ [ 'action' => 'preg_replace', 'from' => '/^(\d+[\.\-]\d+).*/', 'to' => '$1' ],
|
||||
[ 'action' => 'replace', 'from' => '-', 'to' => '.' ] ] ],
|
||||
// oraclelinux-release-6Server-1.0.2
|
||||
// fixme. need more examples
|
||||
];
|
||||
$metatypes = [ 'distro', 'distro_ver' ];
|
||||
foreach (poll_device_unix_packages($device, $metatypes, $distro_def) as $metatype => $value) {
|
||||
$$metatype = $value;
|
||||
}
|
||||
if (safe_empty($distro)) {
|
||||
// there no way for split RedHat vs CentOS..
|
||||
//$distro = 'CentOS';
|
||||
$distro = 'RedHat'; // FIXME. no way for correctly detect redhat or centos, probably by packages?..
|
||||
$distro_ver = str_replace('_', '.', $matches['distro_ver']);
|
||||
}
|
||||
}
|
||||
// * Slackware:
|
||||
// Linux hostname 2.6.21.5-smp #2 SMP Tue Jun 19 14:58:11 CDT 2007 i686
|
||||
} elseif ($poll_device['sysObjectID'] === '.1.3.6.1.4.1.8072.3.2.8' && str_starts($poll_device['sysDescr'], 'FreeBSD ')) {
|
||||
// * HardenedBSD
|
||||
if (preg_match('/\-HBSD /', $poll_device['sysDescr'], $matches)) {
|
||||
$distro = 'HardenedBSD';
|
||||
}
|
||||
}
|
||||
// * Slackware:
|
||||
// Linux hostname 2.6.21.5-smp #2 SMP Tue Jun 19 14:58:11 CDT 2007 i686
|
||||
if (isset($distro)) {
|
||||
print_debug("Linux Distro was set by sysDescr string.");
|
||||
}
|
||||
}
|
||||
|
||||
// Hardware/vendor "extend" support
|
||||
if (is_device_mib($device, 'UCD-SNMP-MIB'))
|
||||
{
|
||||
if (is_device_mib($device, 'UCD-SNMP-MIB')) {
|
||||
$hw = snmp_get_oid($device, '.1.3.6.1.4.1.2021.7890.2.3.1.1.8.104.97.114.100.119.97.114.101', 'UCD-SNMP-MIB');
|
||||
if (strlen($hw))
|
||||
{
|
||||
if (strlen($hw)) {
|
||||
$hardware = rewrite_unix_hardware($poll_device['sysDescr'], $hw);
|
||||
$vendor = snmp_get_oid($device, '.1.3.6.1.4.1.2021.7890.3.3.1.1.6.118.101.110.100.111.114', 'UCD-SNMP-MIB');
|
||||
if (!snmp_status())
|
||||
{
|
||||
if (!snmp_status()) {
|
||||
// Alternative with manufacturer
|
||||
$vendor = snmp_get_oid($device, '.1.3.6.1.4.1.2021.7890.3.3.1.1.12.109.97.110.117.102.97.99.116.117.114.101.114', 'UCD-SNMP-MIB');
|
||||
}
|
||||
$serial = snmp_get_oid($device, '.1.3.6.1.4.1.2021.7890.4.3.1.1.6.115.101.114.105.97.108', 'UCD-SNMP-MIB');
|
||||
//if (str_contains_array($serial, 'denied') || str_starts($serial, [ '0123456789', '..', 'Not Specified' ]))
|
||||
if (!is_valid_param($serial, 'serial'))
|
||||
{
|
||||
if (!is_valid_param($serial, 'serial')) {
|
||||
unset($serial);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Use 'os' script virt output, if virt-what agent is not used
|
||||
if (!isset($agent_data['virt']['what']) && isset($virt))
|
||||
{
|
||||
if (!isset($agent_data['virt']['what']) && isset($virt)) {
|
||||
$agent_data['virt']['what'] = $virt;
|
||||
}
|
||||
|
||||
// Use agent virt-what data if available
|
||||
if (isset($agent_data['virt']['what']))
|
||||
{
|
||||
if (isset($agent_data['virt']['what'])) {
|
||||
// We cycle through every line here, the previous one is overwritten.
|
||||
// This is OK, as virt-what prints general-to-specific order and we want most specific.
|
||||
foreach (explode("\n", $agent_data['virt']['what']) as $virtwhat)
|
||||
{
|
||||
if (isset($config['virt-what'][$virtwhat]))
|
||||
{
|
||||
foreach (explode("\n", $agent_data['virt']['what']) as $virtwhat) {
|
||||
if (isset($config['virt-what'][$virtwhat])) {
|
||||
//$hardware = $config['virt-what'][$virtwhat];
|
||||
$hardware = rewrite_unix_hardware($poll_device['sysDescr'], $config['virt-what'][$virtwhat]);
|
||||
$vendor = ''; // Always reset vendor for VMs, while this doesn't make sense
|
||||
@ -494,8 +490,7 @@ if (isset($agent_data['virt']['what']))
|
||||
}
|
||||
}
|
||||
|
||||
if (!$features && isset($distro))
|
||||
{
|
||||
if (!$features && isset($distro)) {
|
||||
$features = trim("$distro $distro_ver");
|
||||
}
|
||||
|
||||
|
27
includes/polling/os/wisi-tangram.inc.php
Normal file
27
includes/polling/os/wisi-tangram.inc.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage poller
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
// WISI-GTMODULES-MIB::gtThisModuleSlot.0 = 7
|
||||
|
||||
$gtThisModuleSlot = snmp_get_oid($device, 'gtThisModuleSlot.0', 'WISI-GTMODULES-MIB');
|
||||
|
||||
if (!safe_empty($gtThisModuleSlot)) {
|
||||
$data = snmp_get_multi_oid($device, [ 'gtModuleFWID.'.$gtThisModuleSlot, 'gtModuleSerNo.'.$gtThisModuleSlot, 'gtModuleName.'.$gtThisModuleSlot ], [], 'WISI-GTMODULES-MIB');
|
||||
|
||||
$version = $data[$gtThisModuleSlot]['gtModuleFWID'];
|
||||
$serial = $data[$gtThisModuleSlot]['gtModuleSerNo'];
|
||||
$hardware = $data[$gtThisModuleSlot]['gtModuleName'];
|
||||
}
|
||||
|
||||
unset($gtThisModuleSlot, $data);
|
||||
|
||||
// EOF
|
Reference in New Issue
Block a user