2010-07-20 14:03:54 +00:00
|
|
|
<?php
|
|
|
|
|
2015-07-13 18:10:26 +00:00
|
|
|
if (!$os) {
|
2015-10-14 18:44:33 +00:00
|
|
|
$skip_oids = array(
|
|
|
|
'.1.3.6.1.4.1.674.10892.2',
|
|
|
|
'.1.3.6.1.4.1.17163.1.1',
|
2016-06-08 20:16:47 +00:00
|
|
|
'.1.3.6.1.4.1.17713.21',
|
|
|
|
'.1.3.6.1.4.1.2.3.51.3'
|
2015-10-14 18:44:33 +00:00
|
|
|
);
|
|
|
|
if (preg_match('/^Linux/', $sysDescr) && !in_array($sysObjectId, $skip_oids)) {
|
2015-07-13 18:10:26 +00:00
|
|
|
$os = 'linux';
|
|
|
|
}
|
2011-03-29 13:48:03 +00:00
|
|
|
|
2015-07-13 18:10:26 +00:00
|
|
|
// Specific Linux-derivatives
|
|
|
|
if ($os == 'linux') {
|
|
|
|
// Check for QNAP Systems TurboNAS
|
|
|
|
$entPhysicalMfgName = snmp_get($device, 'ENTITY-MIB::entPhysicalMfgName.1', '-Osqnv');
|
2011-03-29 13:48:03 +00:00
|
|
|
|
2016-09-04 03:43:57 +00:00
|
|
|
if (str_contains($sysObjectId, '.1.3.6.1.4.1.5528.100.20.10.2014') || str_contains($sysObjectId, '.1.3.6.1.4.1.5528.100.20.10.2016')) {
|
2015-07-13 18:10:26 +00:00
|
|
|
$os = 'netbotz';
|
2016-09-04 03:43:57 +00:00
|
|
|
} elseif (str_contains($sysDescr, 'endian')) {
|
2015-07-13 18:10:26 +00:00
|
|
|
$os = 'endian';
|
2016-08-28 17:32:58 +00:00
|
|
|
} elseif (preg_match('/Cisco Small Business/', $sysDescr)) {
|
2015-07-13 18:10:26 +00:00
|
|
|
$os = 'ciscosmblinux';
|
2016-08-28 17:32:58 +00:00
|
|
|
} elseif (strpos($entPhysicalMfgName, 'QNAP') !== false) {
|
2015-07-13 18:10:26 +00:00
|
|
|
$os = 'qnap';
|
2016-09-04 03:43:57 +00:00
|
|
|
} elseif (stristr($sysObjectId, 'packetlogic') || str_contains($sysObjectId, '.1.3.6.1.4.1.15397.2')) {
|
2015-07-13 18:10:26 +00:00
|
|
|
$os = 'procera';
|
2016-09-04 03:43:57 +00:00
|
|
|
} elseif (str_contains($sysObjectId, '.1.3.6.1.4.1.10002.1') || str_contains($sysObjectId, '.1.3.6.1.4.1.41112.1.4') || strpos(trim(snmp_get($device, 'dot11manufacturerName.5', '-Osqnv', 'IEEE802dot11-MIB')), 'Ubiquiti') !== false) {
|
2015-07-13 18:10:26 +00:00
|
|
|
$os = 'airos';
|
|
|
|
if (strpos(trim(snmp_get($device, 'dot11manufacturerProductName.5', '-Osqnv', 'IEEE802dot11-MIB')), 'UAP') !== false) {
|
|
|
|
$os = 'unifi';
|
2016-08-28 17:32:58 +00:00
|
|
|
} elseif (strpos(trim(snmp_get($device, 'dot11manufacturerProductName.2', '-Osqnv', 'IEEE802dot11-MIB')), 'UAP') !== false) {
|
2015-07-13 18:10:26 +00:00
|
|
|
$os = 'unifi';
|
2016-08-28 17:32:58 +00:00
|
|
|
} elseif (strpos(trim(snmp_get($device, 'dot11manufacturerProductName.3', '-Osqnv', 'IEEE802dot11-MIB')), 'UAP') !== false) {
|
2015-07-13 18:10:26 +00:00
|
|
|
$os = 'unifi';
|
2016-08-28 17:32:58 +00:00
|
|
|
} elseif (strpos(trim(snmp_get($device, 'dot11manufacturerProductName.4', '-Osqnv', 'IEEE802dot11-MIB')), 'UAP') !== false) {
|
2015-07-13 18:10:26 +00:00
|
|
|
$os = 'unifi';
|
2016-08-28 17:32:58 +00:00
|
|
|
} elseif (strpos(trim(snmp_get($device, 'dot11manufacturerProductName.6', '-Osqnv', 'IEEE802dot11-MIB')), 'UAP') !== false) {
|
2015-07-13 18:10:26 +00:00
|
|
|
$os = 'unifi';
|
2016-08-28 17:32:58 +00:00
|
|
|
} elseif (trim(snmp_get($device, 'fwVersion.1', '-Osqnv', 'UBNT-AirFIBER-MIB')) != '') {
|
2015-07-13 18:10:26 +00:00
|
|
|
$os = 'airos-af';
|
|
|
|
}
|
2016-08-28 17:32:58 +00:00
|
|
|
} elseif (snmp_get($device, 'GANDI-MIB::rxCounter.0', '-Osqnv', 'GANDI-MIB') !== false) {
|
2016-03-03 14:52:44 +00:00
|
|
|
$os = 'pktj';
|
|
|
|
$pktj_mibs = array (
|
|
|
|
"rxCounter" => "GANDI-MIB", // RX Packets
|
|
|
|
"txCounter" => "GANDI-MIB", // TX Packets
|
|
|
|
"dropCounter" => "GANDI-MIB", // Dropped counters
|
|
|
|
"acldropCounter" => "GANDI-MIB", // ACL Dropped counter
|
|
|
|
"ratedropCounter" => "GANDI-MIB", // Rate Dropped counter
|
|
|
|
"KNIrxCounter" => "GANDI-MIB", // KNI RX counter
|
|
|
|
"KNItxCounter" => "GANDI-MIB", // KNI TX counter
|
|
|
|
"KNIdropCounter" => "GANDI-MIB", // KNI DROP counter
|
|
|
|
);
|
|
|
|
register_mibs($device, $pktj_mibs, "include/discovery/os/linux.inc.php");
|
2016-09-04 03:43:57 +00:00
|
|
|
} elseif (stristr($sysObjectId, 'cumulusMib') || str_contains($sysObjectId, '.1.3.6.1.4.1.40310')) {
|
2016-03-14 14:39:45 +00:00
|
|
|
$os = 'cumulus';
|
2016-09-04 03:43:57 +00:00
|
|
|
} elseif (str_contains($sysDescr, array('g56fa85e', 'gc80f187', 'g829be90', 'g63c0044', 'gba768e5'))) {
|
2016-06-16 17:13:18 +00:00
|
|
|
$os = 'sophos';
|
2016-08-29 20:42:42 +00:00
|
|
|
} elseif (snmp_get($device, 'SFA-INFO::systemName.0', '-Osqnv', 'SFA-INFO') !== false) {
|
|
|
|
$os = 'ddnos';
|
2016-08-28 17:32:58 +00:00
|
|
|
} else {
|
2015-07-13 18:10:26 +00:00
|
|
|
// Check for Synology DSM
|
|
|
|
$hrSystemInitialLoadParameters = trim(snmp_get($device, 'HOST-RESOURCES-MIB::hrSystemInitialLoadParameters.0', '-Osqnv'));
|
2011-03-29 13:48:03 +00:00
|
|
|
|
2016-08-18 16:37:28 +00:00
|
|
|
if (strpos($hrSystemInitialLoadParameters, 'syno_hw_version') !== false) {
|
2015-07-13 18:10:26 +00:00
|
|
|
$os = 'dsm';
|
2016-08-28 17:32:58 +00:00
|
|
|
} else {
|
2015-07-13 18:10:26 +00:00
|
|
|
// Check for Carel PCOweb
|
|
|
|
$roomTemp = trim(snmp_get($device, 'roomTemp.0', '-OqvU', 'CAREL-ug40cdz-MIB'));
|
2012-05-02 22:02:30 +00:00
|
|
|
|
2015-07-13 18:10:26 +00:00
|
|
|
if (is_numeric($roomTemp)) {
|
|
|
|
$os = 'pcoweb';
|
|
|
|
}
|
|
|
|
}
|
2012-05-02 11:01:34 +00:00
|
|
|
}
|
2012-04-24 19:19:27 +00:00
|
|
|
}
|
2010-07-20 14:03:54 +00:00
|
|
|
}
|