mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
39 lines
1.8 KiB
PHP
39 lines
1.8 KiB
PHP
<?php
|
|
|
|
|
|
if (starts_with($sysDescr, 'Linux')) {
|
|
$os = 'linux';
|
|
|
|
// Specific Linux-derivatives
|
|
if (starts_with($sysObjectId, array('.1.3.6.1.4.1.5528.100.20.10.2014', '.1.3.6.1.4.1.5528.100.20.10.2016'))) {
|
|
$os = 'netbotz';
|
|
} elseif (str_contains($sysDescr, 'endian')) {
|
|
$os = 'endian';
|
|
} elseif (str_contains($sysDescr, 'Cisco Small Business')) {
|
|
$os = 'ciscosmblinux';
|
|
} elseif (str_contains(snmp_get($device, 'ENTITY-MIB::entPhysicalMfgName.1', '-Osqnv'), 'QNAP')) {
|
|
$os = 'qnap';
|
|
} elseif (starts_with($sysObjectId, '.1.3.6.1.4.1.15397.2')) {
|
|
$os = 'procera';
|
|
} elseif (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')) {
|
|
$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) {
|
|
$os = 'airos-af';
|
|
}
|
|
} elseif (snmp_get($device, 'GANDI-MIB::rxCounter.0', '-Osqnv', 'GANDI-MIB') !== false) {
|
|
$os = 'pktj';
|
|
} elseif (starts_with($sysObjectId, '.1.3.6.1.4.1.40310')) {
|
|
$os = 'cumulus';
|
|
} elseif (str_contains($sysDescr, array('g56fa85e', 'gc80f187', 'g829be90', 'g63c0044', 'gba768e5'))) {
|
|
$os = 'sophos';
|
|
} elseif (snmp_get($device, 'SFA-INFO::systemName.0', '-Osqnv', 'SFA-INFO') !== false) {
|
|
$os = 'ddnos';
|
|
} elseif (is_numeric(trim(snmp_get($device, 'roomTemp.0', '-OqvU', 'CAREL-ug40cdz-MIB', 'carel')))) {
|
|
$os = 'pcoweb'; // Carel PCOweb
|
|
} elseif (starts_with($sysDescr, 'Linux mirthtemplate')) {
|
|
$os = 'mirth';
|
|
}
|
|
}
|