Page 1 of 1

Netwatch; continual reboots

Posted: Fri Feb 13, 2009 3:21 am
by omnicron
I think I did a bad thing.

I have a wireless card (Verizon wireless) on the MT (3.17) and it works fine but sometimes the wireless just wont work anymore. It normally stops after a day or two. So in my infinite wisdom I setup a netwatch to ping a remote IP and then reboot the system it if does not respond.

Well the wireless died and it reboot but before it has a chance for the wireless verizon card to come up it reboots again.

I must have set the timeout too low or something. I dont recall what all the values are right now.

How do I get into the machine if it keeps just rebooting. I dont want to blow out the whole config.

Any ideas?

Thanks

Tim

Re: Netwatch; continual reboots

Posted: Fri Feb 13, 2009 5:28 pm
by galaxynet
omnicron -

If you can get a serial cable on it you can telnet / ssh or use Hyperterminal to get in to the box and turn off netwatch. /system netwatch ..........

R/

Re: Netwatch; continual reboots

Posted: Fri Feb 13, 2009 8:02 pm
by omnicron
I have the console screen but it says starting services and then reboots so I have NO chance to login either serial or console tty.

Any other ideas? Can I mount he FS on a linux system and remove the config somehow?

omnicron -

If you can get a serial cable on it you can telnet / ssh or use Hyperterminal to get in to the box and turn off netwatch. /system netwatch ..........

R/

Re: Netwatch; continual reboots

Posted: Fri Feb 13, 2009 8:21 pm
by galaxynet
omnicron -

Use the netinsall server to 'hold on' to the RB. Then use the serial connection to get in to ROS and turn netwatch off.

R/

Thom

Re: Netwatch; continual reboots

Posted: Fri Feb 13, 2009 8:53 pm
by omnicron
I did not understand the hold on the RB with netinstall thing but I was able to mount the drive under RHEL and remove the offending netwatch command.

Thanks for all the help everyone.
Tim

Re: Netwatch; continual reboots

Posted: Thu Nov 19, 2009 12:25 am
by fatslim
i have the same problem. need help. please!

Re: Netwatch; continual reboots

Posted: Thu Nov 19, 2009 12:30 am
by omnicron
If you can not get into the device because it reboots to fast due to the netwatch reboot command, you need to put the MT fielesystem on a linux box (this is what I did) and delete the file with the config for the netwatch command. I don't remember which one it was since this was a while ago.

The issue was the clock ran too fast on my SMP Core2Duo and would not give the netwatch command time to complete and it would reboot the router. A MT update fixed that issue a while ago.

Tim

Re: Netwatch; continual reboots

Posted: Thu Nov 19, 2009 9:27 am
by fatslim
i found solution for my situation. i am using RB433AH v4.2. i set CPU clock to 100Mhz and router started to work very slow so i was able to login using serial cable and paste "tool netwatch disable numbers=2" command.

It would be great if in future RouterOS releases something like Safe Mode

sorry for my bad english :roll:

Re: Netwatch; continual reboots

Posted: Thu Nov 19, 2009 4:27 pm
by Chupaka
It would be great if in future RouterOS releases something like Safe Mode
if you don't know about it, it doesn't mean that it doesn't exist =)
http://wiki.mikrotik.com/wiki/Safe_mode#Safe_Mode

Re: Netwatch; continual reboots

Posted: Sat Nov 21, 2009 7:02 pm
by fatslim
It would be great if in future RouterOS releases something like Safe Mode
if you don't know about it, it doesn't mean that it doesn't exist =)
http://wiki.mikrotik.com/wiki/Safe_mode#Safe_Mode
thanks. i didnt knew about this safe mode. i think it will be useful for me in future configuration, but at this situation it would be useful only before lockout. and what to do when i am unable to login to my router i cant press [crtl]+[x]? so when i was saying safe mode i meant to log in to router bypassing all the configuration and ability to change it.

Re: Netwatch; continual reboots

Posted: Sat Nov 21, 2009 7:09 pm
by Chupaka
to log in to router bypassing all the configuration and ability to change it.
MAC-Telnet and MAC WinBox are for this =)

Re: Netwatch; continual reboots

Posted: Sun Jan 08, 2012 1:06 pm
by Saasouh
Is there any one who could help me out here please.

Sometimes my network crash until I reboot the main router which is RB433, I need to have a script that will reboot that router in case the network crash.
I am not so good in programming please right down the script so I can copy and past.


Thank you

Re: Netwatch; continual reboots

Posted: Mon Jan 09, 2012 11:02 am
by Chupaka
the script to reboot is
/system reboot

Re: Netwatch; continual reboots

Posted: Mon Jan 09, 2012 10:43 pm
by Saasouh
thank you Mr. Chupaka for replying, could you please tell me where to write it , in another word should I use netwatch or watchdog and writ the script in system down?

Re: Netwatch; continual reboots

Posted: Tue Jan 10, 2012 11:09 am
by Chupaka
yes, you may use NetWatch

Watchdog reboots the router by itself, w/o any scripting

Re: Netwatch; continual reboots

Posted: Tue Jan 10, 2012 4:50 pm
by Saasouh
Can you please be more specific , I need to know how to program watch dog to reboot the router in case of network failure.

thank u in advanced

Re: Netwatch; continual reboots

Posted: Tue Jan 10, 2012 8:02 pm
by boen_robot
In netwatch, add a new watch, set your ISP's gateway as the "host" parameter, set any interval (the gateway will be verified once per the interval specified; short timeout means more stress on the router and quick reboot in case of failure, longer timeout means less stress on the router and potentially longer time before an automatic reboot), and as "down" script, specify "/system reboot".

That is all.

Re: Netwatch; continual reboots

Posted: Sat Jan 14, 2012 4:16 pm
by Saasouh
I wrote this in Netwatch :

log info "Netwatch missed a ping to 192.168.61.7 - starting 1 minute timeout script" ; /system script run NetWatchBoot-192.168.61.7

and I wrote this script in system scripts:

:if ([/ping 192.168.61.7 interval=1 count=60] =0) do={
/system reboot
}

but the router still not rebooting by itself

what is wrong ?
or should I just forget about the log and write: / system reboot in "down" in netwatch?

Re: Netwatch; continual reboots

Posted: Sat Jan 14, 2012 4:36 pm
by boen_robot
or should I just forget about the log and write: / system reboot in "down" in netwatch?
Yes, you can do that, but keep in mind the router will reboot as soon as you loose connection (+ the interval time or less), whereas doing what you're trying to do will reboot the router if the connection is lost + the interval time or less + the required time for the 60 pings to take place and timeout (60 seconds in your case).