LLDP topology discovery for MikroTik Cloud RouterOS

LLDP discovery with MikroTik devices doesn’t work right now out of the box. From a first investigation, it seems like parts of the LLDP MIB are not fully implemented and Enhanced-Linked shows an error message LLDP_MIB not supported. The LLDP topology in his example is extremely simple:

An SNMP walk shows the following output from these devices:

router-1:

snmpwalk -v 2c -c public 172.16.8.25 1.0.8802.1.1.2.1
(Unknown Module)::iso.0.8802.1.1.2.1.3.4.0 = String: MikroTik RouterOS 6.48.4 (stable) CHR
(Unknown Module)::iso.0.8802.1.1.2.1.3.5.0 = String: (
(Unknown Module)::iso.0.8802.1.1.2.1.3.6.0 = String:  
(Unknown Module)::iso.0.8802.1.1.2.1.3.7.1.2.1 = Integer: 3
(Unknown Module)::iso.0.8802.1.1.2.1.3.7.1.3.1 = String: 00:0C:29:0F:D9:BD
(Unknown Module)::iso.0.8802.1.1.2.1.3.7.1.4.1 = String: ether1
(Unknown Module)::iso.0.8802.1.1.2.1.4.1.1.4.0.0.1 = Integer: 4
(Unknown Module)::iso.0.8802.1.1.2.1.4.1.1.5.0.0.1 = String: 00:0C:29:AD:3C:FD
(Unknown Module)::iso.0.8802.1.1.2.1.4.1.1.6.0.0.1 = Integer: 5
(Unknown Module)::iso.0.8802.1.1.2.1.4.1.1.7.0.0.1 = String: ether1
(Unknown Module)::iso.0.8802.1.1.2.1.4.1.1.9.0.0.1 = String: router-2
(Unknown Module)::iso.0.8802.1.1.2.1.4.1.1.10.0.0.1 = String: 
(Unknown Module)::iso.0.8802.1.1.2.1.4.1.1.11.0.0.1 = String: .
(Unknown Module)::iso.0.8802.1.1.2.1.4.1.1.12.0.0.1 = String: .
(Unknown Module)::iso.0.8802.1.1.2.1.4.2.1.1.0.0.1 = Integer: 1
(Unknown Module)::iso.0.8802.1.1.2.1.4.2.1.2.0.0.1 = String: 172.16.8.26

router-2:

snmpwalk -v 2c -c public 172.16.8.26 1.0.8802.1.1.2.1

Enhanced-Linkd debug output:emphasized text

(Unknown Module)::iso.0.8802.1.1.2.1.3.4.0 = String: MikroTik RouterOS 6.48.4 (stable) CHR
(Unknown Module)::iso.0.8802.1.1.2.1.3.5.0 = String: (
(Unknown Module)::iso.0.8802.1.1.2.1.3.6.0 = String:  
(Unknown Module)::iso.0.8802.1.1.2.1.3.7.1.2.1 = Integer: 3
(Unknown Module)::iso.0.8802.1.1.2.1.3.7.1.3.1 = String: 00:0C:29:AD:3C:FD
(Unknown Module)::iso.0.8802.1.1.2.1.3.7.1.4.1 = String: ether1
(Unknown Module)::iso.0.8802.1.1.2.1.4.1.1.4.0.0.1 = Integer: 4
(Unknown Module)::iso.0.8802.1.1.2.1.4.1.1.5.0.0.1 = String: 00:0C:29:0F:D9:BD
(Unknown Module)::iso.0.8802.1.1.2.1.4.1.1.6.0.0.1 = Integer: 5
(Unknown Module)::iso.0.8802.1.1.2.1.4.1.1.7.0.0.1 = String: ether1
(Unknown Module)::iso.0.8802.1.1.2.1.4.1.1.9.0.0.1 = String: router-1
(Unknown Module)::iso.0.8802.1.1.2.1.4.1.1.10.0.0.1 = String: 
(Unknown Module)::iso.0.8802.1.1.2.1.4.1.1.11.0.0.1 = String: .
(Unknown Module)::iso.0.8802.1.1.2.1.4.1.1.12.0.0.1 = String: .
(Unknown Module)::iso.0.8802.1.1.2.1.4.2.1.1.0.0.1 = Integer: 1
(Unknown Module)::iso.0.8802.1.1.2.1.4.2.1.2.0.0.1 = String: 172.16.8.25
2021-09-28 11:34:02,054 INFO  [Main] o.o.n.d.AbstractSpringContextJmxServiceDaemon: enlinkd starting.
2021-09-28 11:34:02,054 DEBUG [Main] o.o.n.d.AbstractSpringContextJmxServiceDaemon: SPRING: thread.classLoader=java.net.FactoryURLClassLoader@7106e68e
2021-09-28 11:34:02,054 INFO  [Main] o.o.n.d.AbstractServiceDaemon: enlinkd starting.
2021-09-28 11:34:02,062 INFO  [Main] o.o.n.s.LegacyScheduler: start: scheduler started
2021-09-28 11:34:02,062 INFO  [Main] o.o.n.d.AbstractServiceDaemon: enlinkd started.
2021-09-28 11:34:02,062 DEBUG [Main] o.o.n.d.AbstractSpringContextJmxServiceDaemon: SPRING: context.classLoader= java.net.FactoryURLClassLoader@7106e68e
2021-09-28 11:34:02,062 INFO  [Main] o.o.n.d.AbstractSpringContextJmxServiceDaemon: enlinkd starting complete.
2021-09-28 11:34:02,070 DEBUG [java.util.concurrent.ThreadPoolExecutor@32b4edea[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]] o.o.n.s.LegacyScheduler: run: scheduler running
2021-09-28 11:34:02,075 DEBUG [java.util.concurrent.ThreadPoolExecutor@32b4edea[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]] o.o.n.s.LegacyScheduler: run: found ready runnable org.opennms.netmgt.enlinkd.NodesOnmsTopologyUpdater@78f1 (ready in 0ms)
2021-09-28 11:34:02,095 DEBUG [java.util.concurrent.ThreadPoolExecutor@32b4edea[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]] o.o.n.s.LegacyScheduler: thread pool statistics: activeCount=1, taskCount=1, completedTaskCount=0, completedRatio=0.000, poolSize=1
2021-09-28 11:34:02,095 INFO  [EnhancedLinkd-Thread-1-of-5] o.o.n.e.c.Discovery: run: running NodesTopologyUpdater initial:0 interval:30000
2021-09-28 11:34:02,095 DEBUG [EnhancedLinkd-Thread-1-of-5] o.o.n.e.c.TopologyUpdater: run: start NodesTopologyUpdater
2021-09-28 11:34:02,095 DEBUG [java.util.concurrent.ThreadPoolExecutor@32b4edea[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]] o.o.n.s.LegacyScheduler: run: found ready runnable org.opennms.netmgt.enlinkd.UserDefinedLinkTopologyUpdater@78f1 (ready in 0ms)
2021-09-28 11:34:02,121 DEBUG [java.util.concurrent.ThreadPoolExecutor@32b4edea[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]] o.o.n.s.LegacyScheduler: thread pool statistics: activeCount=2, taskCount=2, completedTaskCount=0, completedRatio=0.000, poolSize=2
2021-09-28 11:34:02,121 DEBUG [java.util.concurrent.ThreadPoolExecutor@32b4edea[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]] o.o.n.s.LegacyScheduler: run: found ready runnable org.opennms.netmgt.enlinkd.LldpOnmsTopologyUpdater@78f1 (ready in 0ms)
2021-09-28 11:34:02,125 INFO  [EnhancedLinkd-Thread-2-of-5] o.o.n.e.c.Discovery: run: running org.opennms.netmgt.enlinkd.UserDefinedLinkTopologyUpdater initial:0 interval:30000
2021-09-28 11:34:02,126 DEBUG [EnhancedLinkd-Thread-2-of-5] o.o.n.e.c.TopologyUpdater: run: start org.opennms.netmgt.enlinkd.UserDefinedLinkTopologyUpdater
2021-09-28 11:34:02,148 DEBUG [java.util.concurrent.ThreadPoolExecutor@32b4edea[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]] o.o.n.s.LegacyScheduler: thread pool statistics: activeCount=3, taskCount=3, completedTaskCount=0, completedRatio=0.000, poolSize=3
2021-09-28 11:34:02,149 DEBUG [java.util.concurrent.ThreadPoolExecutor@32b4edea[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]] o.o.n.s.LegacyScheduler: run: found ready runnable org.opennms.netmgt.enlinkd.NodeDiscoveryLldp@4be1a3c3 (ready in 0ms)
2021-09-28 11:34:02,152 INFO  [EnhancedLinkd-Thread-3-of-5] o.o.n.e.c.Discovery: run: running LldpTopologyUpdater initial:0 interval:30000
2021-09-28 11:34:02,152 DEBUG [EnhancedLinkd-Thread-3-of-5] o.o.n.e.c.TopologyUpdater: run: start LldpTopologyUpdater
2021-09-28 11:34:02,155 DEBUG [java.util.concurrent.ThreadPoolExecutor@32b4edea[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]] o.o.n.s.LegacyScheduler: thread pool statistics: activeCount=4, taskCount=4, completedTaskCount=0, completedRatio=0.000, poolSize=4
2021-09-28 11:34:02,156 DEBUG [java.util.concurrent.ThreadPoolExecutor@32b4edea[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]] o.o.n.s.LegacyScheduler: run: found ready runnable org.opennms.netmgt.enlinkd.NodeDiscoveryLldp@4be1a3e1 (ready in 0ms)
2021-09-28 11:34:02,156 INFO  [EnhancedLinkd-Thread-4-of-5] o.o.n.e.c.Discovery: run: running NodeDiscoveryLldp node:[15] ip:172.16.8.26NodeDiscoveryLldp initial:3000 interval:86400000
2021-09-28 11:34:02,158 DEBUG [java.util.concurrent.ThreadPoolExecutor@32b4edea[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]] o.o.n.s.LegacyScheduler: thread pool statistics: activeCount=5, taskCount=5, completedTaskCount=0, completedRatio=0.000, poolSize=5
2021-09-28 11:34:02,158 DEBUG [java.util.concurrent.ThreadPoolExecutor@32b4edea[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]] o.o.n.s.LegacyScheduler: run: found ready runnable org.opennms.netmgt.enlinkd.NodeDiscoveryLldp@607a4c72 (ready in 0ms)
2021-09-28 11:34:02,159 DEBUG [java.util.concurrent.ThreadPoolExecutor@32b4edea[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]] o.o.n.s.LegacyScheduler: thread pool statistics: activeCount=5, taskCount=6, completedTaskCount=0, completedRatio=0.000, poolSize=5
2021-09-28 11:34:02,159 DEBUG [java.util.concurrent.ThreadPoolExecutor@32b4edea[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]] o.o.n.s.LegacyScheduler: run: found ready runnable org.opennms.netmgt.enlinkd.NodeDiscoveryLldp@1ed199f8 (ready in 0ms)
2021-09-28 11:34:02,159 DEBUG [java.util.concurrent.ThreadPoolExecutor@32b4edea[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]] o.o.n.s.LegacyScheduler: thread pool statistics: activeCount=5, taskCount=7, completedTaskCount=0, completedRatio=0.000, poolSize=5
2021-09-28 11:34:02,160 DEBUG [java.util.concurrent.ThreadPoolExecutor@32b4edea[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]] o.o.n.s.LegacyScheduler: run: no ready runnables scheduled, waiting...
2021-09-28 11:34:02,160 INFO  [EnhancedLinkd-Thread-5-of-5] o.o.n.e.c.Discovery: run: running NodeDiscoveryLldp node:[16] ip:172.16.8.25NodeDiscoveryLldp initial:3000 interval:86400000
2021-09-28 11:34:02,968 DEBUG [EnhancedLinkd-Thread-4-of-5] o.o.n.s.s.Snmp4JWalker: Walking lldpLocalGroup for /172.16.8.26 using version SNMPv2c with config: SnmpAgentConfig[Address: 172.16.8.26, ProxyForAddress: null, Port: 161, Timeout: 1800, Retries: 1, MaxVarsPerPdu: 10, MaxRepetitions: 2, MaxRequestSize: 65535, Version: v2c, TTL: null, ReadCommunity: XXXXXXXX, WriteCommunity: XXXXXXXX]
2021-09-28 11:34:02,967 DEBUG [EnhancedLinkd-Thread-5-of-5] o.o.n.s.s.Snmp4JWalker: Walking lldpLocalGroup for /172.16.8.25 using version SNMPv2c with config: SnmpAgentConfig[Address: 172.16.8.25, ProxyForAddress: null, Port: 161, Timeout: 1800, Retries: 1, MaxVarsPerPdu: 10, MaxRepetitions: 2, MaxRequestSize: 65535, Version: v2c, TTL: null, ReadCommunity: XXXXXXXX, WriteCommunity: XXXXXXXX]
2021-09-28 11:34:02,987 DEBUG [EnhancedLinkd-Thread-5-of-5] o.o.n.s.SingleInstanceTracker: Requesting oid following: .1.0.8802.1.1.2.1.3.1
2021-09-28 11:34:02,991 DEBUG [EnhancedLinkd-Thread-4-of-5] o.o.n.s.SingleInstanceTracker: Requesting oid following: .1.0.8802.1.1.2.1.3.1
2021-09-28 11:34:03,007 DEBUG [EnhancedLinkd-Thread-4-of-5] o.o.n.s.SingleInstanceTracker: Requesting oid following: .1.0.8802.1.1.2.1.3.2
2021-09-28 11:34:03,007 DEBUG [EnhancedLinkd-Thread-5-of-5] o.o.n.s.SingleInstanceTracker: Requesting oid following: .1.0.8802.1.1.2.1.3.2
2021-09-28 11:34:03,007 DEBUG [EnhancedLinkd-Thread-5-of-5] o.o.n.s.SingleInstanceTracker: Requesting oid following: .1.0.8802.1.1.2.1.3.3
2021-09-28 11:34:03,007 DEBUG [EnhancedLinkd-Thread-4-of-5] o.o.n.s.SingleInstanceTracker: Requesting oid following: .1.0.8802.1.1.2.1.3.3
2021-09-28 11:34:03,037 DEBUG [EnhancedLinkd-Thread-4-of-5] o.o.n.s.s.Snmp4JWalker: Sending tracker pdu of size 3
2021-09-28 11:34:03,047 DEBUG [EnhancedLinkd-Thread-5-of-5] o.o.n.s.s.Snmp4JWalker: Sending tracker pdu of size 3
2021-09-28 11:34:03,181 DEBUG [EnhancedLinkd-Thread-5-of-5] o.s.Snmp: Running pending async request with handle PduHandle[551514536] and retry count left 1
2021-09-28 11:34:03,182 DEBUG [EnhancedLinkd-Thread-4-of-5] o.s.Snmp: Running pending async request with handle PduHandle[2132499397] and retry count left 1
2021-09-28 11:34:03,478 DEBUG [DefaultUDPTransportMapping_0.0.0.0/0] o.s.Snmp: Looking up pending request with handle PduHandle[551514536]
2021-09-28 11:34:03,478 DEBUG [DefaultUDPTransportMapping_0.0.0.0/0] o.s.Snmp: Looking up pending request with handle PduHandle[2132499397]
2021-09-28 11:34:03,494 DEBUG [DefaultUDPTransportMapping_0.0.0.0/0] o.s.Snmp: Cancelling pending request with handle PduHandle[551514536]
2021-09-28 11:34:03,502 DEBUG [DefaultUDPTransportMapping_0.0.0.0/0] o.o.n.s.s.Snmp4JWalker: Received a tracker PDU of type RESPONSE from /172.16.8.25 of size 3, errorStatus = 0, errorStatusText = Success, errorIndex = 0
2021-09-28 11:34:03,507 DEBUG [DefaultUDPTransportMapping_0.0.0.0/0] o.s.Snmp: Cancelling pending request with handle PduHandle[2132499397]
2021-09-28 11:34:03,509 DEBUG [DefaultUDPTransportMapping_0.0.0.0/0] o.o.n.s.s.Snmp4JWalker: Received a tracker PDU of type RESPONSE from /172.16.8.26 of size 3, errorStatus = 0, errorStatusText = Success, errorIndex = 0
2021-09-28 11:34:03,625 DEBUG [DefaultUDPTransportMapping_0.0.0.0/0] o.o.n.s.SingleInstanceTracker: Processing varBind: .1.0.8802.1.1.2.1.3.3.0 = router-2
2021-09-28 11:34:03,625 DEBUG [DefaultUDPTransportMapping_0.0.0.0/0] o.o.n.s.SingleInstanceTracker: Processing varBind: .1.0.8802.1.1.2.1.3.3.0 = router-1
2021-09-28 11:34:03,626 DEBUG [DefaultUDPTransportMapping_0.0.0.0/0] o.o.n.s.SingleInstanceTracker: Processing varBind: .1.0.8802.1.1.2.1.3.3.0 = router-1
2021-09-28 11:34:03,627 DEBUG [DefaultUDPTransportMapping_0.0.0.0/0] o.o.n.s.SingleInstanceTracker: Processing varBind: .1.0.8802.1.1.2.1.3.3.0 = router-2
2021-09-28 11:34:03,627 DEBUG [DefaultUDPTransportMapping_0.0.0.0/0] o.o.n.s.SingleInstanceTracker: Processing varBind: .1.0.8802.1.1.2.1.3.3.0 = router-1
2021-09-28 11:34:03,627 DEBUG [DefaultUDPTransportMapping_0.0.0.0/0] o.o.n.s.SingleInstanceTracker: Processing varBind: .1.0.8802.1.1.2.1.3.3.0 = router-2
2021-09-28 11:34:03,690 DEBUG [DefaultUDPTransportMapping_0.0.0.0/0] o.o.n.s.SnmpStore: Storing Result: alias: lldpLocSysName [.1.0.8802.1.1.2.1.3.3].[0] = STRING: router-1 (726f757465722d31)
2021-09-28 11:34:03,690 DEBUG [DefaultUDPTransportMapping_0.0.0.0/0] o.o.n.s.SnmpStore: Storing Result: alias: lldpLocSysName [.1.0.8802.1.1.2.1.3.3].[0] = STRING: router-2 (726f757465722d32)
2021-09-28 11:34:03,692 INFO  [EnhancedLinkd-Thread-5-of-5] o.o.n.e.NodeDiscoveryLldp: run: node[16]: LLDP_MIB not supported
2021-09-28 11:34:03,693 DEBUG [EnhancedLinkd-Thread-5-of-5] o.o.n.s.LegacyScheduler: schedule: Adding ready runnable org.opennms.netmgt.enlinkd.NodeDiscoveryLldp@4be1a3e1 (ready in 86399999ms) at interval 86400000
2021-09-28 11:34:03,694 DEBUG [EnhancedLinkd-Thread-5-of-5] o.o.n.s.LegacyScheduler: schedule: interval queue did not exist, a new one has been created
2021-09-28 11:34:03,694 DEBUG [EnhancedLinkd-Thread-5-of-5] o.o.n.s.LegacyScheduler: schedule: queue element added, calling notify all since none were scheduled
2021-09-28 11:34:03,697 INFO  [EnhancedLinkd-Thread-4-of-5] o.o.n.e.NodeDiscoveryLldp: run: node[15]: LLDP_MIB not supported

Unknown Module from snmpwalk - does that imply you missing mibs for the OS snmp sysytem?

I just didn’t have the LLDP_MIB available on the OS, that’s the reason snmpwalk doesn’t resolve the OID’s accordingly. The important part is OpenNMS gets values from the given OIDs.

We have opened an enhanced request for this topic in JIRA in NMS-13637 Discover LLDP topology on devices running MikroTik RouterOS, if you are interested in this feature please use the up-vote function using a free JIRA account.