mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix: NIOS detection #4420
This commit is contained in:
committed by
Neil Lathwood
parent
a8efda8f30
commit
7f7e3d22bc
@@ -6,10 +6,10 @@ if (!$os) {
|
||||
'.1.3.6.1.4.1.17163.1.1',
|
||||
'.1.3.6.1.4.1.17713.21',
|
||||
'.1.3.6.1.4.1.2.3.51.3',
|
||||
'.1.3.6.1.4.1.7779.1', // nios
|
||||
'.1.3.6.1.4.1.7779.', // nios
|
||||
);
|
||||
|
||||
if (starts_with($sysDescr, 'Linux') && !in_array($sysObjectId, $skip_oids)) {
|
||||
if (starts_with($sysDescr, 'Linux') && !starts_with($sysObjectId, $skip_oids)) {
|
||||
$os = 'linux';
|
||||
|
||||
// Specific Linux-derivatives
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
if (!$os) {
|
||||
if (str_contains($sysObjectId, ".1.3.6.1.4.1.7779.1")) {
|
||||
if (starts_with($sysObjectId, '.1.3.6.1.4.1.7779.')) {
|
||||
$os = 'nios';
|
||||
}
|
||||
}
|
||||
|
@@ -114,7 +114,7 @@ function getHostOS($device)
|
||||
$sysDescr = snmp_get($device, "SNMPv2-MIB::sysDescr.0", "-Ovq");
|
||||
$sysObjectId = snmp_get($device, "SNMPv2-MIB::sysObjectID.0", "-Ovqn");
|
||||
|
||||
d_echo("| $sysDescr | $sysObjectId | ");
|
||||
d_echo("| $sysDescr | $sysObjectId | \n");
|
||||
|
||||
$pattern = $config['install_dir'] . '/includes/discovery/os/*.inc.php';
|
||||
foreach (glob($pattern) as $file) {
|
||||
|
@@ -131,7 +131,8 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testNios()
|
||||
{
|
||||
$this->checkOS('nios', 'Linux 3.14.25 #1 SMP Thu Jun 16 18:19:37 EDT 2016 x86_64', '.1.3.6.1.4.1.7779.1');
|
||||
$this->checkOS('nios', 'Linux 3.14.25 #1 SMP Thu Jun 16 18:19:37 EDT 2016 x86_64', '.1.3.6.1.4.1.7779.1.1402');
|
||||
$this->checkOS('nios', 'IPAM', '.1.3.6.1.4.1.7779.1.1004');
|
||||
}
|
||||
|
||||
public function testPcoweb()
|
||||
|
Reference in New Issue
Block a user