Community discussions

MikroTik App
 
cololine
Member Candidate
Member Candidate
Topic Author
Posts: 106
Joined: Wed May 27, 2009 1:11 am

Feature requests for watchdog timer

Thu Aug 09, 2012 12:45 am

Hello -

Having just started working with the watchdog feature, I see some deficiencies that could be fixed with a few improvements, adding a few new fields/values:

1. More than one target IP for ping - I'd like to be able to specify up to three, because just one IP is putting all your eggs in one basket and my eggs have been broken a couple of times already. The watchdog would not reboot the router unless *all* specified targets timed out for the specified number of times (see below);

2. Ping interval - obviously this would have an allowable range;

3. Number of consecutive ping timeouts required for reboot - currently it's hard-coded at six timeouts in ten-second intervals, so one minute of timeouts reboots the router. That's a bit scant; if my carrier reboots something on a hardwired path between me and the target, such as the router that serves me my link, that could trigger a reboot on my side. Being able to adjust this value allows me to allow for that.

4. Allow for more latency. Right now it appears that any watchdog ping that does not respond in a few hundred ms is treated as a timeout. It's not common for a gateway to take that long to return a ping, but I am seeing latency higher than that off and on in one of my facilities right now and it caused a watchdog-driven reboot. Unfortunately the gateway is the most logical choice for a ping target as it is the very next hop off of the router, but upstream routers give this kind of traffic the lowest priority. So a setting for maximum allowable latency would be good.

We are talking about a function that is going to reboot the router, so I really think the additional controls are justified.

Thanks!
Ed
 
Wazza
newbie
Posts: 45
Joined: Thu Oct 13, 2011 10:43 am

Re: Feature requests for watchdog timer

Thu Aug 09, 2012 11:24 am

The watchdog is really there to protect the router itself... That is, if the router OS or hardware locks up. It's not supposed to be used for "network related" actions...

While I agree that some improvements could be made to the watchdog, it should be a pretty "basic" function, and pretty much all the features you want could easily be done with a script. (My last recourse is to reboot the router, not the first...)

Rgds,

Wazza
 
cololine
Member Candidate
Member Candidate
Topic Author
Posts: 106
Joined: Wed May 27, 2009 1:11 am

Re: Feature requests for watchdog timer

Thu Aug 09, 2012 4:36 pm

I hear you. But if there is going to be a ping function, it should be implemented properly with parameters that can be controlled. Currently it's pretty much useless. BTW I have occasionally seen Ethernet ports go haywire and enter a blocking state, so that's where this ping function could be used. However, after playing with it a bit I'm not using it in it's current incarnation because it's too primitive.
 
m1byo
just joined
Posts: 9
Joined: Thu Aug 16, 2012 12:27 pm

Re: Feature requests for watchdog timer

Thu Sep 13, 2012 12:49 pm

I am a +1 for the multiple ping addresses.

One of the main reasons I bought this a MikroTik router was for the ping watchdog functionality (and the added configurabilty, but that was more difficult to persuade the wife with!).

my Virgin Media modem kept crashing once every 24 hours ish and the solution was always to reboot the router, therefore using the watchdog, it kept the internet connection working.

about 4 months after getting the new router, I finally managed to pursade virgin it was their modem and not my routers (not the easiest of tasks!) and they agreed to replace the router.

Since then I have not had any crashes due the VM modem, but I have left the watchdog enabled checking the internet connection. Unfortunatley I have had downtime and then issues where the connection was dropping every 6 minutes due to the single server being checked on the internet dissapearing although I could still access the internet.

If this was three servers where one IP Address was checked and if successful would leave it there, otherwise check the next IP etc. This would have solved this problem for me.
 
m1byo
just joined
Posts: 9
Joined: Thu Aug 16, 2012 12:27 pm

Re: Feature requests for watchdog timer

Fri Sep 14, 2012 12:41 pm

After a suggestion from Mikrotik support, I have written the following script that will do the job.
:if ([/ping 173.194.65.94 count=5] = 0) do={
   
      :log info "Ping 1 (Google) Failed"
      :if ([/ping 23.62.98.216 count=5] = 0) do={
   
         :log info "Ping 2 (direct.gov) Failed"
         :if ([/ping 64.4.11.42 count=5] = 0) do={
   
            :log info "Ping 3 (Microsoft) Failed"
            /system reboot
   
            } else={
               :log info "Ping 3 (Microsoft) success"
            }
   
         } else={
               :log info "Ping 2 (direct.gov) success"
         }
   
   } else={
      :log info "Ping 1 (Google) success"
   }
I am now looking at putting a counter in there as well to count for the first 5 minutes of operation, but that is proving a little more frustrating.

I will post updated code when I get it working.
 
m1byo
just joined
Posts: 9
Joined: Thu Aug 16, 2012 12:27 pm

Re: Feature requests for watchdog timer

Fri Sep 14, 2012 12:48 pm

This now works with a 5 script runs delay before starting to check sites (allows links to be up before starting).

Change : if (netcount > 5) do={ to whatever number you want to reflect the delay.

I have got this script scheduled to trigger every minute (similar to the watchdog ping). If you dont want a log full of "ping 1 success) then remove the final :log info "Ping 1 (Google) success" from the script.
:global netcount
:set netcount ( $netcount + 1)

: if (netcount > 5) do={

:if ([/ping 173.194.65.94 count=5] = 0) do={
   
      :log info "Ping 1 (Google) Failed"
      :if ([/ping 23.62.98.216 count=5] = 0) do={
   
         :log info "Ping 2 (direct.gov) Failed"
         :if ([/ping 64.4.11.42 count=5] = 0) do={
   
            :log info "Ping 3 (Microsoft) Failed"
            /system reboot
   
            } else={
               :log info "Ping 3 (Microsoft) success"
            }
   
         } else={
               :log info "Ping 2 (direct.gov) success"
         }
   
   } else={
      :log info "Ping 1 (Google) success"
   }
}

Who is online

Users browsing this forum: Ahrefs [Bot], bcmdevtl, Bing [Bot] and 28 guests