mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
refactor os discovery s to w
This commit is contained in:
@@ -1,21 +1,18 @@
|
||||
<?php
|
||||
|
||||
if (!$os) {
|
||||
if (preg_match('/^SunOS/', $sysDescr)) {
|
||||
$os = 'solaris';
|
||||
list(,,$version) = explode(' ', $sysDescr);
|
||||
if ($version > '5.10') {
|
||||
if (starts_with('SunOS', $sysDescr)) {
|
||||
$os = 'solaris';
|
||||
list(,,$version) = explode(' ', $sysDescr);
|
||||
|
||||
if(version_compare($version, '5.10', '>')) {
|
||||
if (str_contains('oi_', $sysDescr)) {
|
||||
$os = 'openindiana';
|
||||
} else {
|
||||
$os = 'opensolaris';
|
||||
}
|
||||
|
||||
if ($version > '5.10') {
|
||||
if (preg_match('/oi_/', $sysDescr)) {
|
||||
$os = 'openindiana';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (strstr($sysObjectId, '.1.3.6.1.4.1.42.2.1.1')) {
|
||||
$os = 'solaris';
|
||||
}
|
||||
}
|
||||
|
||||
if (str_contains('.1.3.6.1.4.1.42.2.1.1', $sysObjectId)) {
|
||||
$os = 'solaris';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user