Community discussions

MikroTik App
 
valent
newbie
Topic Author
Posts: 43
Joined: Wed Dec 07, 2005 8:47 pm

script for keeping adls router in shape?

Sun Sep 24, 2006 8:52 pm

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.
 
User avatar
Eugene
Forum Veteran
Forum Veteran
Posts: 986
Joined: Mon May 31, 2004 5:06 pm
Location: Cranfield, UK

Mon Sep 25, 2006 3:34 pm

no way to do this in RouterOS.
 
valent
newbie
Topic Author
Posts: 43
Joined: Wed Dec 07, 2005 8:47 pm

Mon Sep 25, 2006 6:40 pm

no way to do this in RouterOS.
Ah, then we will do it form a linux box on the network.
 
User avatar
savagedavid
Trainer
Trainer
Posts: 320
Joined: Thu Aug 25, 2005 12:58 pm
Location: Cape Town, South Africa
Contact:

Tue Sep 26, 2006 10:32 pm

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.
 
User avatar
Eugene
Forum Veteran
Forum Veteran
Posts: 986
Joined: Mon May 31, 2004 5:06 pm
Location: Cranfield, UK

Wed Sep 27, 2006 12:19 pm

/system telnet works only in interactive mode.
 
User avatar
savagedavid
Trainer
Trainer
Posts: 320
Joined: Thu Aug 25, 2005 12:58 pm
Location: Cape Town, South Africa
Contact:

Wed Sep 27, 2006 8:40 pm

Then indeed it would not work!

Who is online

Users browsing this forum: No registered users and 6 guests