omega1
Posts: 113
Joined: Mon Jul 02, 2012 3:10 pm
Location: UK
Contact: Website

Watchdog monitoring eth0?

Sun Mar 17, 2013 11:29 am

Hi all,

I decided to install watchdog to monitor my eth0 port as I need my Pi to always have network connectivity and thought that I could use watchdog to monitor it.

I installed watchdog OK and managed to get it working, I uncommented the eth0 line and also uncommented the ping line and added my server IP.

When I rebooted, it went into a reboot loop and I had to start from scratch (incidentally, could I have got into it to change the watchdog config back? I tried access via SSH but the reboots were too quick to do anything. Just in case it happens again!)

I have been following this thread http://www.raspberrypi.org/phpBB3/viewt ... 30&t=20149 and have not really been able to follow it due to my lack of linux experience.

I am looking for a reliable way of monitoring whether the Pi has connectivity and rebooting if not.

How do I initially get the watchdog to not load until the Pi has fully booted as from reading elsewhere I am led to believe that it got itself into a reboot loop as the eth0 isn't brought up until after the watchdog has started, hence the reboot loop. Is this correct?

Also, I have read about people's Pi's rebooting randomly with watchdog running. So I'm in a situation where I need to make a call about reliability (catching it before eth0 dies) and keeping it online (availability).

Ideas and suggestions?

Thanks!
Get your Pi from here! http://bit.ly/18blVup

thomas41546
Posts: 10
Joined: Tue Nov 29, 2011 4:04 pm

Re: Watchdog monitoring eth0?

Mon Mar 18, 2013 8:06 pm

An easy way to monitor connectivity is to write a simple bash script that checks if you have network access every x seconds..

You could use the ping command against a website like google.com -- send 4 messages and expect atleast 4 back -- if you get less than perform your network-disconnected behavior.

omega1
Posts: 113
Joined: Mon Jul 02, 2012 3:10 pm
Location: UK
Contact: Website

Re: Watchdog monitoring eth0?

Mon Mar 18, 2013 8:27 pm

Hi thomas,

Do you know where I could find such a script (both to get the results and interpreter them and also to perform the network disconnect (and connect)).

Thanks!
Get your Pi from here! http://bit.ly/18blVup

Return to “General programming discussion”