Home Linux Community Forums Software Command Line Good watchdog for services?

Good watchdog for services?

Link to this post 14 May 09

You can try nagios...It's far away from being simple to configure but certainly is one of the best "watchdogs" out there.


Link to this post 14 May 09

If the program creates a pid file you can use checkproc

checkproc -p <pid file> <app name>


checkproc -p /var/run/ /usr/local/daemon/

I use this in my init scripts for all my perl daemons.

It could be easily used in a bash script to check the return / exit code.

echo $?

Exit Codes:
0 = Running
1 = Dead but pid exists
3.= Dead and no pid

You may also want to read up on startproc and killproc. I suggest starting with the man pages. There are lots of useful options that can make your bash script very powerful. Then pop it into cron to automate it.



Link to this post 15 May 09

If you are running Fedora 9 or later, or Ubuntu 6.10 or later, the good ol' standard init system has been quietly replaced with upstart.

They actually almost did too good of a job implementing this, since most people didn't even notice the change. ;)

While I've never set it up to do this, it is supposed to be able to monitor services and restart them automagically if they die.

Its configuration (at least on Fedora) lives in /etc/event.d

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Linux Training / Board