[NTLUG:Discuss] Service Watchdog Script

Carl Haddick sysmail at glade.net
Mon Oct 5 15:08:24 CDT 2009


On Mon, Oct 05, 2009 at 10:03:30AM -0700, CoryC wrote:
> Does anybody have an example of a service watchdog script that they are willing to share? All of the examples I'm finding on the Internet only work if the service uses a port but not all of the services I want to monitor use a port (Snort, arpwatch, etc.). I'd like for it to be able to e-mail me when one of those services are down and possibly even try to restart it. I'm using CentOS 5.3.
> 
> Thanks,
> 
> Cory 
> 
I've never met the man, but I suspect Dan Bernstein is a rather
crotchety sort.  Maybe I'm being judgemental.

Anyway, his daemontools package works well.  The idea is a watchdog is
run from init, and the watchdog starts and stops processes via a control
utility, svc.

A program is brought under daemontools by creating a directory with a
'run' script.

If you wanted notification you could do that in the 'run' script.

I bet there are more modern alternatives, too.

Regards,

Carl



More information about the Discuss mailing list