refactor: Updated os discovery files (a) (#4514)

This commit is contained in:
Neil Lathwood
2016-09-21 18:53:39 +01:00
committed by Tony Murray
parent 369bfaf508
commit 24fe69be3d
26 changed files with 97 additions and 180 deletions

View File

@@ -1,11 +1,5 @@
<?php
if (!$os) {
if (strstr($sysDescr, '3Com Switch ')) {
$os = '3com';
} elseif (strstr($sysDescr, '3Com SuperStack')) {
$os = '3com';
} elseif (strstr($sysDescr, '3Com Baseline')) {
$os = '3com';
}
if (str_contains($sysDescr, array('3Com Switch ', '3Com SuperStack', '3Com Baseline',))) {
$os = '3com';
}

View File

@@ -1,7 +1,5 @@
<?php
if (!$os) {
if ((strstr($sysObjectId, '1.3.6.1.4.1.8072.3.2.10')) && (strstr($sysDescr, 'Acano'))) {
$os = 'acano';
}
if (starts_with($sysObjectId, '.1.3.6.1.4.1.8072.3.2.10') && str_contains($sysDescr, 'Acano')) {
$os = 'acano';
}

View File

@@ -1,7 +1,5 @@
<?php
if (!$os) {
if (strstr($sysObjectId, '.1.3.6.1.4.1.9.1.1117')) {
$os = 'acs';
}
if (starts_with($sysObjectId, '.1.3.6.1.4.1.9.1.1117')) {
$os = 'acs';
}

View File

@@ -1,16 +1,7 @@
<?php
if (!$os) {
if (strstr($sysDescr, 'Cisco Application Control Software')) {
$os = 'acsw';
}
if (strstr($sysDescr, 'Application Control Engine')) {
$os = 'acsw';
}
}
if (!$os) {
if (strstr($sysObjectId, '.1.3.6.1.4.1.9.1.1291')) {
$os = 'acsw';
}
if (str_contains($sysDescr, array('Application Control Engine', 'Cisco Application Control Software'))) {
$os = 'acsw';
} elseif (starts_with($sysObjectId, '.1.3.6.1.4.1.9.1.1291')) {
$os = 'acsw';
}

View File

@@ -1,5 +1,4 @@
<?php
/*
* LibreNMS ADTRAN AOS OS Discovery module
*
@@ -12,11 +11,8 @@
* the source code distribution for details.
*/
if (!$os) {
if (preg_match('/NetVanta/', $sysDescr)) {
$os = 'adtran-aos';
} elseif (strstr($sysObjectId, '.1.3.6.1.4.1.664')) {
$os = 'adtran-aos';
}
if (str_contains($sysDescr, 'NetVanta')) {
$os = 'adtran-aos';
} elseif (starts_with($sysObjectId, '.1.3.6.1.4.1.664')) {
$os = 'adtran-aos';
}

View File

@@ -1,5 +1,4 @@
<?php
/*
* LibreNMS Acceidan MetroNID OS Discovery module
*
@@ -12,9 +11,6 @@
* the source code distribution for details.
*/
if (!$os) {
if (preg_match('/AMN-/', $sysDescr)) {
$os = 'aen';
}
if (str_contains($sysDescr, 'AMN-')) {
$os = 'aen';
}

View File

@@ -9,8 +9,6 @@
* option) any later version. Please see LICENSE.txt at the top level of
* the source code distribution for details.
*/
if (!$os) {
if (stristr($sysDescr, 'HiveOS')) {
$os = 'aerohive';
}
if (str_contains($sysDescr, 'HiveOS')) {
$os = 'aerohive';
}

View File

@@ -1,13 +1,5 @@
<?php
if (!$os) {
if (strstr($sysDescr, 'Apple AirPort')) {
$os = 'airport';
}
if (strstr($sysDescr, 'Apple Base Station')) {
$os = 'airport';
}
if (strstr($sysDescr, 'Base Station V3.84')) {
$os = 'airport';
}
if (str_contains($sysDescr, array('Apple AirPort', 'Apple Base Station', 'Base Station V3.84'))) {
$os = 'airport';
}

View File

@@ -1,11 +1,5 @@
<?php
if (!$os) {
if (preg_match('/8VD-X20/', $sysDescr)) {
$os = 'minkelsrms';
}
if (preg_match('/SensorProbe/i', $sysDescr)) {
$os = 'akcp';
}
if (str_contains($sysDescr, 'SensorProbe', true)) {
$os = 'akcp';
}

View File

@@ -1,22 +0,0 @@
<?php
// | Alcatel-Lucent OS6850-U24X 6.4.3.520.R01 GA, April 08, 2010. | .1.3.6.1.4.1.6486.800.1.1.2.1.7.1.10 |
if (!$os) {
if (strpos($sysObjectId, '.1.3.6.1.4.1.6486.800') !== false) {
if (strstr($sysDescr, 'AOS-W')) {
$os = 'arubaos';
} else {
$os = 'aos';
}
} elseif (strpos($sysObjectId, '.1.3.6.1.4.1.6486.801') !== false) {
$os = 'aos';
} elseif (strpos($sysObjectId, '.1.3.6.1.4.1.6527.1.3') !== false
|| strpos($sysObjectId, '.1.3.6.1.4.1.6527.6.2.1.2.2.') !== false // TiMOS-B-2.0.R3 both/mpc ALCATEL SAS-M 7210
|| strpos($sysObjectId, '.1.3.6.1.4.1.6527.1.6.1') !== false // TiMOS-B-6.1.R14 both/hops ALCATEL ESS 7450
|| strpos($sysObjectId, '.1.3.6.1.4.1.6527.6.1.1.2.') !== false // TiMOS-B-6.0.R2 both/hops ALCATEL-LUCENT SAR 7705
|| strpos($sysObjectId, '.1.3.6.1.4.1.6527.1.9.1') !== false // TiMOS-B-6.1.R14 both/hops ALCATEL SR 7710
|| strpos($sysObjectId, '.1.3.6.1.4.1.6527.1.15.') !== false // TiMOS-C-12.0.R16 cpm/hops64 ALCATEL XRS 7950
) {
$os = 'timos';
}
}//end if

View File

@@ -1,11 +1,5 @@
<?php
if (!$os) {
if (strstr($sysObjectId, '.1.3.6.1.4.1.207')) {
$os = 'allied';
}
if (strstr($sysObjectId, '.1.3.6.1.4.1.207.1.4.126')) {
unset($os);
}
if (starts_with($sysObjectId, '.1.3.6.1.4.1.207') && !starts_with($sysObjectId, '.1.3.6.1.4.1.207.1.4.126')) {
$os = 'allied';
}

View File

@@ -0,0 +1,10 @@
<?php
// | Alcatel-Lucent OS6850-U24X 6.4.3.520.R01 GA, April 08, 2010. | .1.3.6.1.4.1.6486.800.1.1.2.1.7.1.10 |
if (starts_with($sysObjectId, '.1.3.6.1.4.1.6486.800')) {
if (!str_contains($sysDescr, 'AOS-W')) {
$os = 'aos';
}
} elseif (starts_with($sysObjectId, '.1.3.6.1.4.1.6486.801')) {
$os = 'aos';
}

View File

@@ -1,14 +1,14 @@
<?php
if (!$os) {
$apcDesc = array(
'APC Web/SNMP Management Card',
'APC Switched Rack PDU',
'APC MasterSwitch PDU',
'APC Metered Rack PDU',
);
$apc_desc = array(
'APC Web/SNMP Management Card',
'APC Switched Rack PDU',
'APC MasterSwitch PDU',
'APC Metered Rack PDU',
);
if (str_contains($sysDescr, $apcDesc)) {
$os = 'apc';
}
if (str_contains($sysDescr, $apc_desc)) {
$os = 'apc';
}
unset($apc_desc);

View File

@@ -1,7 +1,6 @@
<?php
if (!$os) {
if (strstr($sysDescr, 'Raid Subsystem V')) {
$os = 'areca';
}
if (str_contains($sysDescr, 'Raid Subsystem V')) {
$os = 'areca';
}

View File

@@ -1,7 +1,5 @@
<?php
if (!$os) {
if (strstr($sysDescr, 'Arista Networks EOS')) {
$os = 'arista_eos';
}
if (str_contains($sysDescr, 'Arista Networks EOS')) {
$os = 'arista_eos';
}

View File

@@ -1,7 +1,8 @@
<?php
if (!$os) {
if (strstr($sysDescr, 'ArubaOS')) {
$os = 'arubaos';
}
// | Alcatel-Lucent OS6850-U24X 6.4.3.520.R01 GA, April 08, 2010. | .1.3.6.1.4.1.6486.800.1.1.2.1.7.1.10 |
if (str_contains($sysDescr, 'ArubaOS')) {
$os = 'arubaos';
} elseif (starts_with($sysObjectId, '.1.3.6.1.4.1.6486.800') && str_contains($sysDescr, 'AOS-W')) {
$os = 'arubaos';
}

View File

@@ -1,7 +1,5 @@
<?php
if (!$os) {
if (preg_match('/^Cisco\ Adaptive\ Security\ Appliance/', $sysDescr)) {
$os = 'asa';
}
if (starts_with($sysDescr, 'Cisco Adaptive Security Appliance')) {
$os = 'asa';
}

View File

@@ -1,9 +1,5 @@
<?php
if (!$os) {
if (strstr($sysDescr, 'Ethernet Routing Switch')) {
$os = 'avaya-ers';
} elseif (strstr($sysDescr, 'ERS-')) {
$os = 'avaya-ers';
}
if (str_contains($sysDescr, array('Ethernet Routing Switch', 'ERS-'))) {
$os = 'avaya-ers';
}

View File

@@ -1,7 +1,5 @@
<?php
if (!$os) {
if (strstr(snmp_get($device, 'ENTITY-MIB::entPhysicalDescr.1', '-Oqvn'), 'Avaya IP Office')) {
$os = "avaya-ipo";
}
if (str_contains(snmp_get($device, 'ENTITY-MIB::entPhysicalDescr.1', '-Oqvn'), 'Avaya IP Office')) {
$os = "avaya-ipo";
}

View File

@@ -11,33 +11,14 @@
* the source code distribution for details.
*/
if (!$os) {
if (strstr($sysObjectId, '.1.3.6.1.4.1.2272.202')) {
// VSP-4850GTS
$os = 'avaya-vsp';
}
if (strstr($sysObjectId, '.1.3.6.1.4.1.2272.203')) {
// VSP-4850GTS-PWR+
$os = 'avaya-vsp';
}
if (strstr($sysObjectId, '.1.3.6.1.4.1.2272.205')) {
// VSP-8284XSQ
$os = 'avaya-vsp';
}
if (strstr($sysObjectId, '.1.3.6.1.4.1.2272.206')) {
// VSP-4450GSX-PWR+
$os = 'avaya-vsp';
}
if (strstr($sysObjectId, '.1.3.6.1.4.1.2272.208')) {
// VSP-8404
$os = 'avaya-vsp';
}
if (strstr($sysObjectId, '.1.3.6.1.4.1.2272.209')) {
// VSP-7254XSQ
$os = 'avaya-vsp';
}
if (strstr($sysObjectId, '.1.3.6.1.4.1.2272.210')) {
// VSP-7254XTQ
$os = 'avaya-vsp';
}
if (starts_with($sysObjectId, array(
'.1.3.6.1.4.1.2272.202',
'.1.3.6.1.4.1.2272.203',
'.1.3.6.1.4.1.2272.205',
'.1.3.6.1.4.1.2272.206',
'.1.3.6.1.4.1.2272.208',
'.1.3.6.1.4.1.2272.209',
'.1.3.6.1.4.1.2272.210',
))) {
$os = 'avaya-vsp';
}

View File

@@ -1,11 +1,5 @@
<?php
if (!$os) {
if (preg_match('/^Avocent/', $sysDescr)) {
$os = 'avocent';
}
if (preg_match('/^AlterPath/', $sysDescr)) {
$os = 'avocent';
}
if (starts_with($sysDescr, array('Avocent', 'AlterPath'))) {
$os = 'avocent';
}

View File

@@ -1,6 +1,6 @@
<?php
if (!$os) {
if (strstr($sysObjectId, '.20916.1.')) {
$os = 'avtech';
}
if (str_contains($sysObjectId, '.20916.1.')) {
$os = 'avtech';
}

View File

@@ -1,7 +1,5 @@
<?php
if (!$os) {
if (preg_match('/AXIS .* (Network Camera|Video Server|Network Video Encoder)/', $sysDescr)) {
$os = 'axiscam';
}
if (preg_match('/AXIS .* (Network Camera|Video Server|Network Video Encoder)/', $sysDescr)) {
$os = 'axiscam';
}

View File

@@ -1,7 +1,5 @@
<?php
if (!$os) {
if (preg_match('/^AXIS .* Network Document Server/', $sysDescr)) {
$os = 'axisdocserver';
}
if (preg_match('/^AXIS .* Network Document Server/', $sysDescr)) {
$os = 'axisdocserver';
}

View File

@@ -0,0 +1,5 @@
<?php
if (str_contains($sysDescr, '8VD-X20')) {
$os = 'minkelsrms';
}

View File

@@ -0,0 +1,12 @@
<?php
if (starts_with($sysObjectId, array(
'.1.3.6.1.4.1.6527.1.3',
'.1.3.6.1.4.1.6527.6.2.1.2.2.',
'.1.3.6.1.4.1.6527.1.6.1',
'.1.3.6.1.4.1.6527.6.1.1.2.',
'.1.3.6.1.4.1.6527.1.9.1',
'.1.3.6.1.4.1.6527.1.15.',
))) {
$os = 'timos';
}