Fun with the Dude

0

Mikrotik make a network monitoring package for their routers called The Dude.

While it’s mostly pretty powerful and flexible, I’ve found some ways to customize it to make it work better for me that you might find useful too.

Sending Slack notifications

The default notifications options for external sending that come with the Dude include syslog and email. I’d like to get Slack notifications when a device goes down on my network, so I’ve used the “execute on server” option to make an API call to Slack to post a message to a particular channel using a webhook and the /tool fetch command.

Here’s the RouterOS command to run to make it happen (make sure to insert your Slack Webhook URI):

/tool fetch http-method=post url="https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX" http-header-field="Content-Type: application/json" http-data="{\"text\": \"Service `[Probe.Name]` on `[Device.Name]` ([Device.FirstAddress]) is now `[Service.Status]`\"}" output=none

And here’s the result when you click “Test”

Number of total clients on a UniFi access points

The UniFi console is nice and all, but I really want one pane of glass for monitoring. I’ve enabled SNMP on my access points, installed the UniFi MIB into the Dude and configured a device to display the number of total clients:

[sum(oid_column("iso.org.dod.internet.private.enterprises.ubnt.ubntMIB.ubntUniFi.unifiApWireless.unifiVapTable.unifiVapEntry.unifiVapNumStations")
)]

The sum and oid_column functions allows us to combine the count for all SSIDs as the client count is reported separately for each SSID via SNMP.

I’ve also used the Dude to graph the number over time, because why not:

No Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.