Files
librenms-librenms/includes/discovery/os/linux.inc.php
T

36 lines
1.7 KiB
PHP
Raw Normal View History

<?php
2016-09-09 09:57:40 -05:00
2017-01-15 09:20:27 -06:00
if (starts_with($sysDescr, 'Linux') || starts_with($sysObjectId, '.1.3.6.1.4.1.8072.3.2.10')) {
2016-09-24 16:34:54 +03:00
$os = 'linux';
// Specific Linux-derivatives
2017-02-04 17:49:36 -06:00
if (starts_with($sysObjectId, array('.1.3.6.1.4.1.10002.1', '.1.3.6.1.4.1.41112.1.4')) || str_contains(snmp_get($device, 'dot11manufacturerName.5', '-Osqnv', 'IEEE802dot11-MIB'), 'Ubiquiti')) {
2016-09-24 16:34:54 +03:00
$os = 'airos';
if (str_contains(snmp_walk($device, 'dot11manufacturerProductName', '-Osqnv', 'IEEE802dot11-MIB'), 'UAP')) {
$os = 'unifi';
} elseif (snmp_get($device, 'fwVersion.1', '-Osqnv', 'UBNT-AirFIBER-MIB', 'ubnt') !== false) {
2016-09-24 16:34:54 +03:00
$os = 'airos-af';
}
2017-03-06 14:11:10 +00:00
} elseif (snmp_get($device, 'extrahopInfoVersionString', '-Osqnv', 'EXTRAHOP-MIB', 'extrahop') !== false) {
$os = 'extrahop';
2016-09-24 16:34:54 +03:00
} elseif (snmp_get($device, 'GANDI-MIB::rxCounter.0', '-Osqnv', 'GANDI-MIB') !== false) {
$os = 'pktj';
} elseif (snmp_get($device, 'SFA-INFO::systemName.0', '-Osqnv', 'SFA-INFO') !== false) {
$os = 'ddnos';
2016-12-17 19:49:56 +00:00
} elseif (is_numeric(trim(snmp_get($device, 'roomTemp.0', '-OqvU', 'CAREL-ug40cdz-MIB', 'carel')))) {
2016-09-24 16:34:54 +03:00
$os = 'pcoweb'; // Carel PCOweb
} elseif ($wrt = snmp_get($device, '.1.3.6.1.4.1.2021.7890.1.101.1', '-Osqnv')) {
$wrt = trim($wrt, '"');
if (starts_with($wrt, 'ASUSWRT-Merlin')) {
$os = 'asuswrt-merlin';
} elseif (starts_with($wrt, 'Tomato ')) {
$os = 'tomato';
}
} elseif (preg_match('/^QNAP Systems/', snmp_get($device, "entPhysicalMfgName.1", "-Ovqn", "ENTITY-MIB"))) {
$os = 'qnap';
} elseif (str_contains(snmp_get($device, 'upsIdentAgentSoftwareVersion.0', '-Osqnv', 'UPS-MIB'), 'RemotEye4')) {
$os = 'remoteye4';
}
}