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?
Any help or suggestions are always appreciated.