Netwatch; continual reboots
RouterOS Scripting and API

19 posts   •   Page 1 of 1
omnicron
just joined
 
Posts: 23
Joined: Wed Dec 29, 2004 10:57 am

Netwatch; continual reboots

by omnicron » Fri Feb 13, 2009 4:21 am

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

galaxynet
Long time Member
Long time Member
 
Posts: 597
Joined: Fri Dec 17, 2004 3:52 pm

Re: Netwatch; continual reboots

by galaxynet » Fri Feb 13, 2009 6:28 pm

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/
Thom Lawless
General Manager
RapidWiFi, LLC
thom.lawless [at] rapidwifi.com

omnicron
just joined
 
Posts: 23
Joined: Wed Dec 29, 2004 10:57 am

Re: Netwatch; continual reboots

by omnicron » Fri Feb 13, 2009 9:02 pm

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?


galaxynet wrote: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/

galaxynet
Long time Member
Long time Member
 
Posts: 597
Joined: Fri Dec 17, 2004 3:52 pm

Re: Netwatch; continual reboots

by galaxynet » Fri Feb 13, 2009 9:21 pm

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
Thom Lawless
General Manager
RapidWiFi, LLC
thom.lawless [at] rapidwifi.com

omnicron
just joined
 
Posts: 23
Joined: Wed Dec 29, 2004 10:57 am

Re: Netwatch; continual reboots

by omnicron » Fri Feb 13, 2009 9:53 pm

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

fatslim
newbie
 
Posts: 30
Joined: Mon Dec 01, 2008 2:21 pm
Location: Lithuania, Kaunas

Re: Netwatch; continual reboots

by fatslim » Thu Nov 19, 2009 1:25 am

i have the same problem. need help. please!

omnicron
just joined
 
Posts: 23
Joined: Wed Dec 29, 2004 10:57 am

Re: Netwatch; continual reboots

by omnicron » Thu Nov 19, 2009 1:30 am

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

fatslim
newbie
 
Posts: 30
Joined: Mon Dec 01, 2008 2:21 pm
Location: Lithuania, Kaunas

Re: Netwatch; continual reboots

by fatslim » Thu Nov 19, 2009 10:27 am

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:

User avatar
Chupaka
Forum Guru
Forum Guru
 
Posts: 7236
Joined: Mon Jun 19, 2006 11:15 pm
Location: Home Network Ltd., Minsk, Belarus

Re: Netwatch; continual reboots

by Chupaka » Thu Nov 19, 2009 5:27 pm

fatslim wrote: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
For every complex problem, there is a solution that is simple, neat, and wrong.

¡ɹǝ|SOɹǝʇnoɹ ʞıʇoɹʞıW ɯ‚|

MikroTik. Your life. Your routing.

skype: pavel.skuratovich

fatslim
newbie
 
Posts: 30
Joined: Mon Dec 01, 2008 2:21 pm
Location: Lithuania, Kaunas

Re: Netwatch; continual reboots

by fatslim » Sat Nov 21, 2009 8:02 pm

Chupaka wrote:
fatslim wrote: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.

User avatar
Chupaka
Forum Guru
Forum Guru
 
Posts: 7236
Joined: Mon Jun 19, 2006 11:15 pm
Location: Home Network Ltd., Minsk, Belarus

Re: Netwatch; continual reboots

by Chupaka » Sat Nov 21, 2009 8:09 pm

fatslim wrote:to log in to router bypassing all the configuration and ability to change it.


MAC-Telnet and MAC WinBox are for this =)
For every complex problem, there is a solution that is simple, neat, and wrong.

¡ɹǝ|SOɹǝʇnoɹ ʞıʇoɹʞıW ɯ‚|

MikroTik. Your life. Your routing.

skype: pavel.skuratovich

Saasouh
just joined
 
Posts: 12
Joined: Sat Dec 10, 2011 2:25 pm

Re: Netwatch; continual reboots

by Saasouh » Sun Jan 08, 2012 2:06 pm

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

User avatar
Chupaka
Forum Guru
Forum Guru
 
Posts: 7236
Joined: Mon Jun 19, 2006 11:15 pm
Location: Home Network Ltd., Minsk, Belarus

Re: Netwatch; continual reboots

by Chupaka » Mon Jan 09, 2012 12:02 pm

the script to reboot is
Code: Select all
/system reboot
For every complex problem, there is a solution that is simple, neat, and wrong.

¡ɹǝ|SOɹǝʇnoɹ ʞıʇoɹʞıW ɯ‚|

MikroTik. Your life. Your routing.

skype: pavel.skuratovich

Saasouh
just joined
 
Posts: 12
Joined: Sat Dec 10, 2011 2:25 pm

Re: Netwatch; continual reboots

by Saasouh » Mon Jan 09, 2012 11:43 pm

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?

User avatar
Chupaka
Forum Guru
Forum Guru
 
Posts: 7236
Joined: Mon Jun 19, 2006 11:15 pm
Location: Home Network Ltd., Minsk, Belarus

Re: Netwatch; continual reboots

by Chupaka » Tue Jan 10, 2012 12:09 pm

yes, you may use NetWatch

Watchdog reboots the router by itself, w/o any scripting
For every complex problem, there is a solution that is simple, neat, and wrong.

¡ɹǝ|SOɹǝʇnoɹ ʞıʇoɹʞıW ɯ‚|

MikroTik. Your life. Your routing.

skype: pavel.skuratovich

Saasouh
just joined
 
Posts: 12
Joined: Sat Dec 10, 2011 2:25 pm

Re: Netwatch; continual reboots

by Saasouh » Tue Jan 10, 2012 5:50 pm

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

User avatar
boen_robot
Forum Guru
Forum Guru
 
Posts: 1322
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: Netwatch; continual reboots

by boen_robot » Tue Jan 10, 2012 9:02 pm

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.
PEAR2_Net_RouterOS(1.0.0b5) - My API client in PHP
(Karma? If you want... no pressure...)

Saasouh
just joined
 
Posts: 12
Joined: Sat Dec 10, 2011 2:25 pm

Re: Netwatch; continual reboots

by Saasouh » Sat Jan 14, 2012 5:16 pm

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?

User avatar
boen_robot
Forum Guru
Forum Guru
 
Posts: 1322
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: Netwatch; continual reboots

by boen_robot » Sat Jan 14, 2012 5:36 pm

Saasouh wrote: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).
PEAR2_Net_RouterOS(1.0.0b5) - My API client in PHP
(Karma? If you want... no pressure...)

19 posts   •   Page 1 of 1

Who is online

Users browsing this forum: Yahoo [Bot] and 9 guests

It is currently Mon Dec 22, 2014 1:14 am