newdevice: Improve Mikrotik RouterOS and SwOS detection (#5772)

Should fix it for good, hurray for stats.librenms.org!
This commit is contained in:
Tony Murray
2017-02-05 04:19:52 -06:00
committed by Neil Lathwood
parent f7724d0f20
commit 27ff1950d5
10 changed files with 9 additions and 24 deletions

View File

@@ -12,3 +12,5 @@ register_mibs:
ciscoAAASessionMIB: CISCO-AAA-SESSION-MIB
poller_modules:
wifi: 1
discovery:
- sysObjectId: .1.3.6.1.4.1.14988.1

View File

@@ -8,3 +8,5 @@ over:
- { graph: device_bits, text: 'Device Traffic' }
- { graph: device_processor, text: 'CPU Usage' }
- { graph: device_mempool, text: 'Memory Usage' }
discovery:
- sysObjectId: .1.3.6.1.4.1.14988.2

View File

@@ -1,9 +0,0 @@
<?php
if (starts_with($sysDescr, 'router') && is_numeric(snmp_get($device, 'SNMPv2-SMI::enterprises.14988.1.1.4.3.0', '-Oqv', ''))) {
$os = 'routeros';
}
if (starts_with($sysDescr, 'RouterOS')) {
$os = 'routeros';
}

View File

@@ -1,7 +0,0 @@
<?php
if (str_contains($sysDescr, array('RB260GS', 'RB250GS', 'RB260GSP'))) {
if (str_contains(snmp_get($device, 'SNMPv2-MIB::sysName.0', '-Oqv', ''), 'MikroTik')) {
$os = 'swos';
}
}

View File

@@ -1454,9 +1454,7 @@ class DiscoveryTest extends \PHPUnit_Framework_TestCase
public function testSwos()
{
$this->checkOS('swos', 'swos-rb250gs');
$this->checkOS('swos', 'swos-rb260gs');
$this->checkOS('swos', 'swos-rb260gsp');
$this->checkOS('swos');
}
public function testSymbol()

View File

@@ -1,2 +1,3 @@
1.3.6.1.2.1.1.1.0|4|router
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.14988.1
1.3.6.1.4.1.14988.1.1.4.3.0|2|1

View File

@@ -1 +1,3 @@
1.3.6.1.2.1.1.1.0|4|RouterOS RB2011UiAS
1.3.6.1.2.1.1.1.0|4|RouterOS RB951G-2HnD
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.14988.1

View File

@@ -1,2 +0,0 @@
1.3.6.1.2.1.1.1.0|4|RB250GS
1.3.6.1.2.1.1.5.0|4|MikroTik

View File

@@ -1,2 +0,0 @@
1.3.6.1.2.1.1.1.0|4|RB260GSP
1.3.6.1.2.1.1.5.0|4|MikroTik