mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Split out OSes where necessary
This commit is contained in:
15
includes/discovery/os/openindiana.inc.php
Normal file
15
includes/discovery/os/openindiana.inc.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
if (starts_with($sysDescr, 'SunOS')) {
|
||||
list(,,$version) = explode(' ', $sysDescr);
|
||||
|
||||
if (version_compare($version, '5.10', '>')) {
|
||||
if (str_contains($sysDescr, 'oi_')) {
|
||||
$os = 'openindiana';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (starts_with($sysObjectId, '.1.3.6.1.4.1.42.2.1.1')) {
|
||||
$os = 'solaris';
|
||||
}
|
11
includes/discovery/os/opensolaris.inc.php
Normal file
11
includes/discovery/os/opensolaris.inc.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
if (starts_with($sysDescr, 'SunOS')) {
|
||||
list(,,$version) = explode(' ', $sysDescr);
|
||||
|
||||
if (version_compare($version, '5.10', '>')) {
|
||||
if (!str_contains($sysDescr, 'oi_')) {
|
||||
$os = 'opensolaris';
|
||||
}
|
||||
}
|
||||
}
|
@@ -8,9 +8,7 @@ if (starts_with($sysDescr, 'Sentry') && str_contains($sysDescr, array('Switched'
|
||||
$version = intval($version[1]);
|
||||
|
||||
// It appears that version 8 and up is good for sentry4
|
||||
if ($version >= 8) {
|
||||
$os = 'sentry4';
|
||||
} else {
|
||||
if ($version < 8) {
|
||||
$os = 'sentry3';
|
||||
}
|
||||
}
|
||||
|
14
includes/discovery/os/sentry4.inc.php
Normal file
14
includes/discovery/os/sentry4.inc.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
if (starts_with($sysDescr, 'Sentry') && str_contains($sysDescr, array('Switched', 'Smart'))) {
|
||||
// ServerTech doesn't have a way to distinguish between sentry3 and sentry4 devices
|
||||
// Hopefully, we can use the version string to figure it out
|
||||
$version = trim(snmp_get($device, 'Sentry3-MIB::serverTech.4.1.1.1.3.0', '-Osqnv'));
|
||||
$version = explode(" ", $version);
|
||||
$version = intval($version[1]);
|
||||
|
||||
// It appears that version 8 and up is good for sentry4
|
||||
if ($version >= 8) {
|
||||
$os = 'sentry4';
|
||||
}
|
||||
}
|
@@ -5,11 +5,7 @@ if (starts_with($sysDescr, 'SunOS')) {
|
||||
list(,,$version) = explode(' ', $sysDescr);
|
||||
|
||||
if (version_compare($version, '5.10', '>')) {
|
||||
if (str_contains($sysDescr, 'oi_')) {
|
||||
$os = 'openindiana';
|
||||
} else {
|
||||
$os = 'opensolaris';
|
||||
}
|
||||
unset($os);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1271,7 +1271,7 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase
|
||||
public function testSwos()
|
||||
{
|
||||
$mockSnmp = array(
|
||||
'SNMPv2-MIB::sysName.0' => 'MicroTik'
|
||||
'SNMPv2-MIB::sysName.0' => 'MikroTik'
|
||||
);
|
||||
$this->checkOS('swos', 'RB250GS', '', $mockSnmp);
|
||||
$this->checkOS('swos', 'RB260GS', '', $mockSnmp);
|
||||
|
Reference in New Issue
Block a user