From 27ff1950d51002cbc8a0d61c8fb5069f7ecb859c Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Sun, 5 Feb 2017 04:19:52 -0600 Subject: [PATCH] newdevice: Improve Mikrotik RouterOS and SwOS detection (#5772) Should fix it for good, hurray for stats.librenms.org! --- includes/definitions/routeros.yaml | 2 ++ includes/definitions/swos.yaml | 2 ++ includes/discovery/os/routeros.inc.php | 9 --------- includes/discovery/os/swos.inc.php | 7 ------- tests/OSDiscoveryTest.php | 4 +--- tests/snmpsim/routeros.snmprec | 1 + tests/snmpsim/routeros1.snmprec | 4 +++- tests/snmpsim/swos-rb250gs.snmprec | 2 -- tests/snmpsim/swos-rb260gsp.snmprec | 2 -- tests/snmpsim/{swos-rb260gs.snmprec => swos.snmprec} | 0 10 files changed, 9 insertions(+), 24 deletions(-) delete mode 100644 includes/discovery/os/routeros.inc.php delete mode 100644 includes/discovery/os/swos.inc.php delete mode 100644 tests/snmpsim/swos-rb250gs.snmprec delete mode 100644 tests/snmpsim/swos-rb260gsp.snmprec rename tests/snmpsim/{swos-rb260gs.snmprec => swos.snmprec} (100%) diff --git a/includes/definitions/routeros.yaml b/includes/definitions/routeros.yaml index 806c1c374a..6580d2714a 100644 --- a/includes/definitions/routeros.yaml +++ b/includes/definitions/routeros.yaml @@ -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 diff --git a/includes/definitions/swos.yaml b/includes/definitions/swos.yaml index 5bfeb3d717..2eb57c8a02 100644 --- a/includes/definitions/swos.yaml +++ b/includes/definitions/swos.yaml @@ -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 diff --git a/includes/discovery/os/routeros.inc.php b/includes/discovery/os/routeros.inc.php deleted file mode 100644 index e501c34a76..0000000000 --- a/includes/discovery/os/routeros.inc.php +++ /dev/null @@ -1,9 +0,0 @@ -checkOS('swos', 'swos-rb250gs'); - $this->checkOS('swos', 'swos-rb260gs'); - $this->checkOS('swos', 'swos-rb260gsp'); + $this->checkOS('swos'); } public function testSymbol() diff --git a/tests/snmpsim/routeros.snmprec b/tests/snmpsim/routeros.snmprec index 0541f6575e..bcc2cb20f1 100644 --- a/tests/snmpsim/routeros.snmprec +++ b/tests/snmpsim/routeros.snmprec @@ -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 diff --git a/tests/snmpsim/routeros1.snmprec b/tests/snmpsim/routeros1.snmprec index 013c31b402..3f2b46cdf3 100644 --- a/tests/snmpsim/routeros1.snmprec +++ b/tests/snmpsim/routeros1.snmprec @@ -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 + diff --git a/tests/snmpsim/swos-rb250gs.snmprec b/tests/snmpsim/swos-rb250gs.snmprec deleted file mode 100644 index cafd057861..0000000000 --- a/tests/snmpsim/swos-rb250gs.snmprec +++ /dev/null @@ -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 diff --git a/tests/snmpsim/swos-rb260gsp.snmprec b/tests/snmpsim/swos-rb260gsp.snmprec deleted file mode 100644 index 708fd99df3..0000000000 --- a/tests/snmpsim/swos-rb260gsp.snmprec +++ /dev/null @@ -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 diff --git a/tests/snmpsim/swos-rb260gs.snmprec b/tests/snmpsim/swos.snmprec similarity index 100% rename from tests/snmpsim/swos-rb260gs.snmprec rename to tests/snmpsim/swos.snmprec