Mikrotik SwOS Issues #3593

Closed
arrmo opened this Issue Jun 3, 2016 · 31 comments

Projects

None yet

5 participants

@arrmo
Contributor
arrmo commented Jun 3, 2016

Hi,

Trying to monitor my Mikrotik RB260GS switch (running SwOS). A few observations,

  • the OS shows up as Mikrotik RouterOS (Level ) => it's really SwOS (not a biggie, just FYI)
  • I have checked, and uptime exists in the SNMP data (below), but it's not showing up in LibreNMS, so the "device rebooted" alarm never clears. FYI, here is what I see in snmpwalk,
    DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (44417797) 5 days, 3:22:57.97
  • For some reason, in LibreNMS, it shows Temperature (Temperature End), Voltage (Voltage End) and State (of MIB) ... but all three seem to be missing any data. I checked, they are not reported in snmpwalk, so why are they "detected"? Perhaps hard coded?

Thanks!

@laf
Member
laf commented Jun 3, 2016

Can you post the output of:

./discovery.php -h HOSTNAME -d -m os
./poller.php -h HOSTNAME -d -m os,sensors -r -f
@laf laf added the Needs-Info label Jun 3, 2016
@arrmo
Contributor
arrmo commented Jun 3, 2016

You bet! Attached, and also - error output, below (I redirected stdout, but not stderr),

  1. discovery
    Error in packet
    Reason: (noSuchName) There is no such variable name in this MIB.
    Failed object: SNMPv2-SMI::enterprises.674.10895.3000.1.2.100.1.0

Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: .1.3.6.1.2.1.47.1.1.1.1.2.1

Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: .1.3.6.1.2.1.47.1.1.1.1.12.1

  1. poller
    Timeout: No Response from udp:mikrotik.home:161.
    Timeout: No Response from udp:mikrotik.home:161.
    Error in packet
    Reason: (noSuchName) There is no such variable name in this MIB.
    Failed object: SNMPv2-SMI::enterprises.14988.1.1.4.4.0

Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: SNMPv2-SMI::enterprises.14988.1.1.4.3.0

.1.3.6.1.4.1.14988.1.1.3.8.End: Unknown Object Identifier (End)
.1.3.6.1.4.1.14988.1.1.3.10.End: Unknown Object Identifier (End)
.1.3.6.1.4.1.14988.1.1.3.10.End: Unknown Object Identifier (End)
.1.3.6.1.4.1.14988.1.1.3.10.End: Unknown Object Identifier (End)
.1.3.6.1.4.1.14988.1.1.3.10.End: Unknown Object Identifier (End)
.1.3.6.1.4.1.14988.1.1.3.10.End: Unknown Object Identifier (End)
.1.3.6.1.4.1.674.10893.1.20.140.1.1.4.End: Unknown Object Identifier (End)

discovery.txt
poller.txt

Thanks!

@laf
Member
laf commented Jun 12, 2016

Weird this one, we overwrite the os to be routeros when we see RB260GS in the sysDescr which is what we see here.

Can the RB260GS have both routeros and swos on it?

@arrmo
Contributor
arrmo commented Jun 13, 2016

Yep, I saw that - was looking at the code inside os (the directory). Not sure that's the right thing to do ... RouterOS and SwOS look to me to be different (link below) - and I think the information provided back is different (i.e. the MIBs are different - I have posted asking about this, but no reply).

And the link - thoughts?
http://www.mikrotik.com/download

Thanks!

@laf
Member
laf commented Jun 13, 2016

Can you install router is and Sw os on the rb260gs?

@paulgear
Member

RB260GS are SwOS only; this really is a separate OS that should be tagged differently.

@arrmo
Contributor
arrmo commented Jun 13, 2016

Agreed! I was trying to say that, but not very well ... LOL.

I have tried, but no luck so far getting the MIB info from the MikroTik folks - care to try?

Thanks!

@laf laf added New-Device and removed Needs-Info labels Jun 15, 2016
@f0o f0o closed this in #3662 Jun 16, 2016
@arrmo
Contributor
arrmo commented Jun 16, 2016

Hmmm .. FYI, I updated (daily.sh), and things have changed - but still some issues I think. Here is the log for this device now,

2016-06-16 06:43:16 Device OS changed routeros => generic
2016-06-16 06:43:16 Device Icon changed routeros => generic

And yes, the icon is gone, the OS is marked as generic - and uptime is still missing?

Thoughts?

@laf laf reopened this Jun 17, 2016
@laf
Member
laf commented Jun 17, 2016
./discovery.php -h HOSTNAME -d -m os
./poller.php -h HOSTNAME -d -m os,sensors -r -f
@arrmo
Contributor
arrmo commented Jun 20, 2016

Sorry for the delay! Traveling right now, out of the country ... :(.

Attached the files - and the .err files are the output seen in the shell.

Thanks!

discovery.err.txt
discovery.log.txt
poller.err.txt
poller.log.txt

@arrmo
Contributor
arrmo commented Jun 25, 2016

Hi,

Likely me just missing the point, but ... I see this check in swos.inc.php,
if (is_numeric(snmp_get($device, 'SNMPv2-SMI::enterprises.14988.2', '-Oqv', ''))) {
$os = 'swos';
}

I'm not seeing data there, but if I check sysDescr.0 ($sysDescr), I get (from snmpget),
SNMPv2-MIB::sysDescr.0 = STRING: RB260GS

Why not check for this value (RB260GS), and then flag SwOS?

Thoughts? I can try it locally, but last time I had a lot of "fun" getting the local repository pulled back upstream ... LOL. Yes, the issue was me ... :(.

OK, just manually checked, here is what I get,

  1. SNMPv2-SMI::enterprises.14988.2
    Error in packet
    Reason: (noSuchName) There is no such variable name in this MIB.
    Failed object: SNMPv2-SMI::enterprises.14988.2
  2. SNMPv2-MIB::sysDescr.0
    SNMPv2-MIB::sysDescr.0 = STRING: RB260GS

Thanks!

@arrmo
Contributor
arrmo commented Jun 25, 2016

Hi,

OK, got the OS portion working, with the following,
if (!$os) {
if ($sysDescr == 'RB260GS') {
$os = 'swos';
}
}

But not seeing the image getting updated (copied html/images/os/routeros.png to html/images/os/swos.png), and also the uptime is not being read / used. Thoughts?

Thanks!

@arrmo
Contributor
arrmo commented Jun 25, 2016

OK, my error on the icon - sorry! Copying over worked - had to re-run discovery (I thought poller would fix this).

Uptime is still missing though.

@arrmo
Contributor
arrmo commented Jun 27, 2016

OK, after a bit more digging here ... seems sysUpTime is a bit odd on this device. If I try,
snmpget -v1 -c public HOSTNAME SNMPv2-MIB::sysUpTime.0

The output is,
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (245503597) 28 days, 9:57:15.97

So the default system command is not working - it's failing, for this one parameter.

Make sense?

@arrmo
Contributor
arrmo commented Jul 4, 2016

FYI, more debugging ... this seems to be related to requesting 5 parameters. Even if I ask for the same thing 5 times (e.g. sysName.0) => then it fails. 4 times is OK, the 5th breaks things.

I have reported this to MikroTik - let's see. But as a workaround - is it possible to break up the request? It may not be, just asking.

Thanks!

@arrmo
Contributor
arrmo commented Jul 12, 2016

FYI, update today from MikroTik => content of an email they sent me back,

Thank you for additional information, the problem is found.
We are looking forward to fix it for upcoming SwOS release.

Will let you know!

@laf
Member
laf commented Jul 13, 2016

Awesome, thanks @arrmo :)

@arrmo
Contributor
arrmo commented Aug 18, 2016

FYI, I have been poking about this, received this email today ...
We have just released SwOS 1.17 with SNMP fixes.
http://www.mikrotik.com/download

And checked - yep, this version works properly! ... :). Close this then?

@arrmo
Contributor
arrmo commented Aug 20, 2016

Hi,

As this is still open - and MikroTik has fixed their bug, but SwOS detection seems to be broken by recent changes. At least on my switch (SwOS), I do see the following,
SNMPv2-MIB::sysName.0 = STRING: MikroTik

Can anyone with a MikroTik router confirm - do you see the same? Perhaps this can be used to detect a MikroTik device?

Thanks!

@Rosiak
Contributor
Rosiak commented Aug 29, 2016

Not sure I understand, is the SwOS detection broken on our end or?

@arrmo
Contributor
arrmo commented Aug 30, 2016

Seems to be, but I could be wrong of course. Now shows up as,
Operating System Generic Device

And the icon (that used to be "correct") is now a gray question mark.

Thanks!

@laf
Member
laf commented Aug 31, 2016

I think swos was reverted again: #4107

No mention of why

@arrmo
Contributor
arrmo commented Aug 31, 2016

Yep, agreed. And not sure either.

Any thoughts on the proposal above? Proposal meaning to use,
SNMPv2-MIB::sysName.0 = STRING: MikroTik

Thanks!

@arrmo
Contributor
arrmo commented Sep 3, 2016

OK, this does work - can put a pull request in ... but first, any suggestions of how to discern between routeros and swos? I have a swos (device) - can anyone share (part of) the output from routeros, to figure out what to key on?

Also, for my SwOS device - it shows Object ID as enterprises.14988.2 => but this is wrong (I think), as if I try to snmpwalk here, I get "End of MIB". Where is Object ID set / used?

Thanks!

@arrmo
Contributor
arrmo commented Sep 3, 2016

OK, how about this? Set the default to routeros, as I assume more routeros than swos devices out there? But then, set the option correctly for their (current) switch? Of course we can add more products, but as they have two OS's under the same sysName - thoughts?

if (!$os) { if (strstr(snmp_get($device, 'SNMPv2-MIB::sysName.0', '-Oqv', ''), 'MikroTik')) { $os = 'routeros'; if (strstr(snmp_get($device, 'SNMPv2-MIB::sysDescr.0', '-Oqv', ''), 'RB260GS')) { $os = 'swos'; } } }

Thanks!

PS: why the heck do linefeeds not work in "code"? Oh well.

@laf
Member
laf commented Sep 8, 2016

@arrmo Let's give that a try, submit a PR and we can get it included.

@arrmo arrmo added a commit to arrmo/librenms that referenced this issue Sep 8, 2016
@arrmo arrmo MikroTik Updates
To address, Mikrotik SwOS Issues (#3593)
3a1b7b0
@arrmo arrmo referenced this issue Sep 8, 2016
Merged

MikroTik Updates #4382

@arrmo
Contributor
arrmo commented Sep 8, 2016

Sure! PR generated.

@laf laf added a commit that referenced this issue Sep 9, 2016
@arrmo @laf arrmo + laf fix: MikroTik OS detection #3593
* MikroTik Updates

To address, Mikrotik SwOS Issues (#3593)

* Remove Default OS Setting
9db1337
@laf laf closed this Sep 9, 2016
@spinza
Contributor
spinza commented Sep 15, 2016

I commented on the commit, but not sure if those do notifications.
This should probably check for 3x SwOS devices:
RB250GS, RB260GS, RB260GSP

@laf laf reopened this Sep 15, 2016
@arrmo
Contributor
arrmo commented Sep 15, 2016

Hi,

I can add these model numbers as well, or if someone else wants to take a run at it no issue here either. Just let me know.

Thanks!

@spinza
Contributor
spinza commented Sep 16, 2016

Would be great if you did? Don't have a dev setup here.

@arrmo
Contributor
arrmo commented Sep 18, 2016

Done - created PR #4483

Thanks!

@murrant murrant referenced this issue Sep 20, 2016
Merged

fix: swos os discovery #4499

2 of 2 tasks complete
@laf laf closed this in #4499 Sep 20, 2016
@laf laf reopened this Sep 21, 2016
@laf laf closed this Sep 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment