netdisco / snmp-info

Other
38 stars 32 forks source link

Enable LLDP Neighbor Discovery on Mikrotik routers #388

Closed sburlappp closed 3 years ago

sburlappp commented 4 years ago

Expected Behavior

Mikrotik's RouterOS now supports LLDP, but NetDisco Discovery doesn't use it yet.

Current Behavior

Discovered Mikrotik devices don't have any neighbors.

Possible Solution

I've tried adding %SNMP::Info::LLDP::* to the usual places at the start of Mikrotik.pm, and even remapped 'lldp_rem_desc' => 'lldpRemPortId' to replace a missing SNMP table column, but it still behaves as it did before.

Steps to Reproduce (for bugs)

~/bin/netdisco-do show -d 1.2.3.4 -e hasLLDP
# returns "1" (true) after my patches
~/bin/netdisco-do discover::neighbors -d 1.2.3.4 -D
# still finds 0 neighbors

Context

My work has a widespread device monitoring network including many dozens of Mikrotiks, currently running a wide range of OS versions, which need better documentation. I could maintain the neighbor data by hand, but it would be much better to automatically detect it, along with any future changes.

Your Device

Your Environment

See Also:

sburlappp commented 4 years ago

The problem seems to involve 'lldp_rman_addr' => 'lldpRemManAddrIfSubtype' (which the Mikrotik doesn't provide), and _lldp_addr_index() in SNMP/Info/LLDP.pm which needs it, although the code there doesn't match the values in the MIB. It looks like it should be lldpRemManAddrSubtype but that didn't work either.

What is the purpose of _lldp_addr_index(), and what inputs does it expect?

sburlappp commented 4 years ago

See also: https://github.com/netdisco/netdisco/issues/608

There appears to be enough data in the existing MIB, but it doesn't completely match what LLDP.pm requires. If there was better support in NetDisco for inferring links from available information (like route next-hops and bridge tables) then LLDP data could be incomplete and still contribute to discovery.

ollyg commented 3 years ago

If there was better support in NetDisco for inferring links from available information (like route next-hops and bridge tables) then LLDP data could be incomplete and still contribute to discovery.

I am going to close this issue. It's not clear what you want SNMP::Info to do differently.

Netdisco already uses routing peer addresses for discovery: https://github.com/netdisco/netdisco/blob/master/lib/App/Netdisco/Worker/Plugin/Discover/Neighbors/Routed.pm

I think what you are getting at is "guessing" connected topology from some heuristics, but this is not what Netdisco or SNMP::Info are doing.

If you wish to input topology information manually, Netdisco has a documented process for this which you can even keep up to date using your own scripts/git etc: https://metacpan.org/dist/App-Netdisco/view/bin/nd-import-topology