Community discussions

MikroTik App
 
mickwilli
just joined
Topic Author
Posts: 7
Joined: Mon Jul 24, 2017 10:16 am

Monitor Dual WAN with Dude

Sat May 12, 2018 11:56 am

Hi All,

I'm currently working on how best to monitor a dual-wan configuration on a router with the Dude.

My ultimate solution would be to have each router ping 2-3 different IP addresses with the interface specified (as can be done with the ping command in Winbox/RouterOS CLI) and if all three hosts do not respond to ping, mark the service as down and raise an alert. I'd of course settle for only pinging one address, but the critical thing is to be able to perform the ping with the interface specified so that it can test one WAN connection only. This does not appear to be supported in The Dude by default (no option to specify the interface).

The approach I thought I would take was to use the 'ros_command' function to execute a ping with a count of say 5 and then measure the number of packets received. This is possible using a RouterOS script as the ping command returns the number of received packets. However, when ping is run using the 'ros_command' function in The Dude, it returns the full ping output, as is shown on the CLI.

So, questions:
  • Does anyone know if it's possible/how to either have RouterOS give out only the packets received as the result of the ping or to parse the output from RouterOS in The Dude?
  • Is there a way that a script could be run on the RouterOS device itself to perform the ping test and then set either an up or down flag elsewhere that The Dude could pick up on with a service?
  • Does anyone have any other ideas of how to effectively monitor a dual-wan configuration with The Dude?
Now it's worth noting that I am aware of the method of using routes to route a specific IP address out a particular WAN link and then to use a standard ping probe to ping that address, but in my mind that's an untidy solution that potentially impacts service, given that it's modifying the routing rules just for the sake of monitoring. I'd prefer to avoid that method if at all possible.

Any help or suggestions are always appreciated.
 
samsung172
Forum Guru
Forum Guru
Posts: 1193
Joined: Sat Apr 04, 2009 3:45 am
Location: Østfold - Norway
Contact:

Re: Monitor Dual WAN with Dude

Sun May 13, 2018 3:00 am

Just make a script pinging the desired ip's - and have it logged to syslog. Setup a syslog reciver - like the dude. Setup a alarm on the dude - emailing, smsm'ing or what you prefeer reciving the messages.
 
mickwilli
just joined
Topic Author
Posts: 7
Joined: Mon Jul 24, 2017 10:16 am

Re: Monitor Dual WAN with Dude

Mon May 14, 2018 10:48 am

Thanks samsung172, I had wondered about that option. One reservation is that it seems like quite a few moving parts, any one of which could fail and cause the monitoring to fail to detect an outage.
 
mickwilli
just joined
Topic Author
Posts: 7
Joined: Mon Jul 24, 2017 10:16 am

Re: Monitor Dual WAN with Dude

Wed May 23, 2018 12:12 pm

For those that are interested, I came up with a good solution.

First, we have static routes that send all traffic for the ISP1 DNS servers out the ISP1 connection and all ISP2 DNS servers out the ISP2 connection (since this is necessary for the DNS servers to work). We then create two 'devices' on the map for each router, one for each of the DNS servers (two servers per ISP). We then use the DNS probe to query the DNS servers, using the router to monitor as the 'agent'. As a result, when either internet connection goes down, the DNS query probe fails and we have that sending email alerts that we've customised to show the information needed to associate the alert with the router in question.

It's not a 100% tidy solution, but it works very effectively. It's also a real service test that requires the full TCP stack, rather than a basic ping.