• MikroTik.com
  • RouterBOARD
  • User Meeting
  • Training
  • User Manual
  • Support
  • Downloads
  • Videos
Register |   * Login | HOME

View unanswered posts | View active topics

Netwatch; continual reboots  Page 1 of 1
 [ 19 posts ]  Post new topic Reply to topic
  Print view Previous topic | Next topic 
Author Message
omnicron
 Post subject: Netwatch; continual reboots
PostPosted: Fri Feb 13, 2009 3:21 am 
Offline
just joined

Joined: Wed Dec 29, 2004 9:57 am
Posts: 23
Karma: 0
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


Top
 Profile  
 
galaxynet
 Post subject: Re: Netwatch; continual reboots
PostPosted: Fri Feb 13, 2009 5:28 pm 
Offline
Long time Member
Long time Member

Joined: Fri Dec 17, 2004 2:52 pm
Posts: 580
Karma: 1
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


Top
 Profile  
 
omnicron
 Post subject: Re: Netwatch; continual reboots
PostPosted: Fri Feb 13, 2009 8:02 pm 
Offline
just joined

Joined: Wed Dec 29, 2004 9:57 am
Posts: 23
Karma: 0
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/


Top
 Profile  
 
galaxynet
 Post subject: Re: Netwatch; continual reboots
PostPosted: Fri Feb 13, 2009 8:21 pm 
Offline
Long time Member
Long time Member

Joined: Fri Dec 17, 2004 2:52 pm
Posts: 580
Karma: 1
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


Top
 Profile  
 
omnicron
 Post subject: Re: Netwatch; continual reboots
PostPosted: Fri Feb 13, 2009 8:53 pm 
Offline
just joined

Joined: Wed Dec 29, 2004 9:57 am
Posts: 23
Karma: 0
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


Top
 Profile  
 
fatslim
 Post subject: Re: Netwatch; continual reboots
PostPosted: Thu Nov 19, 2009 12:25 am 
Offline
newbie

Joined: Mon Dec 01, 2008 1:21 pm
Posts: 30
Karma: 0

Location: Lithuania, Kaunas
i have the same problem. need help. please!


Top
 Profile  
 
omnicron
 Post subject: Re: Netwatch; continual reboots
PostPosted: Thu Nov 19, 2009 12:30 am 
Offline
just joined

Joined: Wed Dec 29, 2004 9:57 am
Posts: 23
Karma: 0
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


Top
 Profile  
 
fatslim
 Post subject: Re: Netwatch; continual reboots
PostPosted: Thu Nov 19, 2009 9:27 am 
Offline
newbie

Joined: Mon Dec 01, 2008 1:21 pm
Posts: 30
Karma: 0

Location: Lithuania, Kaunas
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:


Top
 Profile  
 
Chupaka
 Post subject: Re: Netwatch; continual reboots
PostPosted: Thu Nov 19, 2009 4:27 pm 
Offline
Forum Guru
Forum Guru
User avatar

Joined: Mon Jun 19, 2006 10:15 pm
Posts: 6867
Karma: 110

Location: Home Network Ltd., Minsk, Belarus
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.

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

MikroTik. Your life. Your routing.

skype: pavel.skuratovich


Top
 Profile  
 
fatslim
 Post subject: Re: Netwatch; continual reboots
PostPosted: Sat Nov 21, 2009 7:02 pm 
Offline
newbie

Joined: Mon Dec 01, 2008 1:21 pm
Posts: 30
Karma: 0

Location: Lithuania, Kaunas
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.


Top
 Profile  
 
Chupaka
 Post subject: Re: Netwatch; continual reboots
PostPosted: Sat Nov 21, 2009 7:09 pm 
Offline
Forum Guru
Forum Guru
User avatar

Joined: Mon Jun 19, 2006 10:15 pm
Posts: 6867
Karma: 110

Location: Home Network Ltd., Minsk, Belarus
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.

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

MikroTik. Your life. Your routing.

skype: pavel.skuratovich


Top
 Profile  
 
Saasouh
 Post subject: Re: Netwatch; continual reboots
PostPosted: Sun Jan 08, 2012 1:06 pm 
Offline
just joined

Joined: Sat Dec 10, 2011 1:25 pm
Posts: 12
Karma: 0
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


Top
 Profile  
 
Chupaka
 Post subject: Re: Netwatch; continual reboots
PostPosted: Mon Jan 09, 2012 11:02 am 
Offline
Forum Guru
Forum Guru
User avatar

Joined: Mon Jun 19, 2006 10:15 pm
Posts: 6867
Karma: 110

Location: Home Network Ltd., Minsk, Belarus
the script to reboot is
Code:
/system reboot

_________________
For every complex problem, there is a solution that is simple, neat, and wrong.

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

MikroTik. Your life. Your routing.

skype: pavel.skuratovich


Top
 Profile  
 
Saasouh
 Post subject: Re: Netwatch; continual reboots
PostPosted: Mon Jan 09, 2012 10:43 pm 
Offline
just joined

Joined: Sat Dec 10, 2011 1:25 pm
Posts: 12
Karma: 0
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?


Top
 Profile  
 
Chupaka
 Post subject: Re: Netwatch; continual reboots
PostPosted: Tue Jan 10, 2012 11:09 am 
Offline
Forum Guru
Forum Guru
User avatar

Joined: Mon Jun 19, 2006 10:15 pm
Posts: 6867
Karma: 110

Location: Home Network Ltd., Minsk, Belarus
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.

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

MikroTik. Your life. Your routing.

skype: pavel.skuratovich


Top
 Profile  
 
Saasouh
 Post subject: Re: Netwatch; continual reboots
PostPosted: Tue Jan 10, 2012 4:50 pm 
Offline
just joined

Joined: Sat Dec 10, 2011 1:25 pm
Posts: 12
Karma: 0
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


Top
 Profile  
 
boen_robot
 Post subject: Re: Netwatch; continual reboots
PostPosted: Tue Jan 10, 2012 8:02 pm 
Online
Long time Member
Long time Member
User avatar

Joined: Thu Aug 31, 2006 3:43 pm
Posts: 527
Karma: 77

Location: europe://Bulgaria/Plovdiv
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.0b3) - My API client in PHP


Top
 Profile  
 
Saasouh
 Post subject: Re: Netwatch; continual reboots
PostPosted: Sat Jan 14, 2012 4:16 pm 
Offline
just joined

Joined: Sat Dec 10, 2011 1:25 pm
Posts: 12
Karma: 0
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?


Top
 Profile  
 
boen_robot
 Post subject: Re: Netwatch; continual reboots
PostPosted: Sat Jan 14, 2012 4:36 pm 
Online
Long time Member
Long time Member
User avatar

Joined: Thu Aug 31, 2006 3:43 pm
Posts: 527
Karma: 77

Location: europe://Bulgaria/Plovdiv
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.0b3) - My API client in PHP


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  Page 1 of 1
 [ 19 posts ] 

Board index » RouterOS » Scripting

All times are UTC + 2 hours


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Karma functions powered by Karma MOD © 2007, 2009 m157y