script for keeping adls router in shape?

Hi, can you please help me.

We have s missbehaveing adsl router in out network, which for some or other reason stops working.

So we need a script which does the following:

ping some external site (http://www.google.com) if 5 pings drop login via telnet to adsl router and issue “reboot” command.

or

every 6 hours login via telnet to adsl router and issue “reboot” command

Thank you.

no way to do this in RouterOS.

Ah, then we will do it form a linux box on the network.

I think it should be possible. Something like:

:local i 0; {:do {:set i ($i + 1)} while (($i < 5) && ([/ping 64.77.90.2 interval=3 count=1]=0)}; :if ($i=5) do={/system telnet… }

That would ping the IP address 5 times and if all 5 pings time out you could issue any arbitary commands.

/system telnet works only in interactive mode.

Then indeed it would not work!