fix: NIOS discovery (#4389)

* fix: NIOS discovery
Add nios test

* Add actual sysDescr string for nios
This commit is contained in:
Tony Murray
2016-09-09 09:57:40 -05:00
committed by Neil Lathwood
parent 5ef5d65458
commit b8cc59922e
3 changed files with 10 additions and 3 deletions

View File

@@ -5,8 +5,10 @@ if (!$os) {
'.1.3.6.1.4.1.674.10892.2',
'.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.2.3.51.3',
'.1.3.6.1.4.1.7779.1', // nios
);
if (starts_with($sysDescr, 'Linux') && !in_array($sysObjectId, $skip_oids)) {
$os = 'linux';

View File

@@ -1,6 +1,6 @@
<?php
if (!$os || $os === 'linux') {
if (stristr($sysObjectId, ".1.3.6.1.4.1.7779.1")) {
if (!$os) {
if (str_contains($sysObjectId, ".1.3.6.1.4.1.7779.1")) {
$os = 'nios';
}
}

View File

@@ -117,6 +117,11 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase
$this->checkOS('netbotz', 'Linux', '.1.3.6.1.4.1.5528.100.20.10.2016');
}
public function testNios()
{
$this->checkOS('nios', 'Linux ns01.hepl.ch 3.14.25 #1 SMP Thu Jun 16 18:19:37 EDT 2016 x86_64', '.1.3.6.1.4.1.7779.1');
}
public function testPcoweb()
{
$mockSnmp = array(