[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: automatically restarting dying daemons?



On Wed, Jun 30 at 03:43PM -0700, Mark Ferlatte wrote:
> Will Trillich said on Wed, Jun 30, 2004 at 04:34:06PM -0500:
> > questions:
> > 	1) what's the best way (e.g. debian way) to monitor active
> > 	   daemons and restart them when necessary? maybe some
> > 	   utility already exists for this? or /proc/something?
> > 	   or `ps ax`?
> 
> monit can do this.

so let's go find "monit"...

	# dpkg -l monit
	No packages found matching monit.
	# dpkg -S monit
	imagemagick: /usr/share/doc/imagemagick/html/www/api/monitor.html
	xlibs: /usr/X11R6/include/X11/bitmaps/monitor.xbm
	xlibs: /usr/X11R6/include/X11/pixmaps/monitor.xpm
	svgatextmode: /usr/share/doc/svgatextmode/monitor-timings.howto.gz


	# apt-cache search monit | wc -l
	    226
	# apt-cache search monit | grep monit | wc -l
	     81
	# apt-cache search monit | grep monit | sort | pager

aha! it's "mon"...

	# apt-cache show mon
	Package: mon
	Priority: extra
	Section: admin
	Installed-Size: 800
	Maintainer: Roderick Schertler <roderick@argon.org>
	Architecture: i386
	Version: 0.99.2-2
	Depends: perl, libmon-perl (>= 0.10), libtime-period-perl, libtime-hires-perl, libc6 (>= 2.2.3-7)
	Suggests: fping, libauthen-pam-perl, libfilesys-diskspace-perl, libnet-perl, libnet-dns-perl, libnet-ldap-perl, libnet-telnet-perl, libsnmp-perl, libstatistics-descriptive-perl
	Filename: pool/main/m/mon/mon_0.99.2-2_i386.deb
	Size: 175370
	MD5sum: c98fe7752c129eae0ef3edcd75747276
	Description: monitor hosts/services/whatever and alert about problems
	 "mon" is a tool for monitoring the availability of services.  Services
	 may be network-related, environmental conditions, or anything that can
	 be tested with software.  If a service is unavailable mon can tell you
	 with syslog, email, your pager or a script of your choice.  You can
	 control who gets each alert based on the time of day or day of week,
	 and you can control how often an existing problem is re-alerted.
	 .
	 More information can be found at http://www.kernel.org/software/mon/.

so let's try it--

	# apt-get install mon

	# man mon
	# man moncmd

nosing through the manpages for "mon" and "moncmd", it looks
like this will check (monitor) running daemons and send a flare
when things go bad. so far so good...

but what happens when the daemon that's to receive the flare
(i.e. email -- e.g. exim in this case) is dead? is there some
facility for "when daemon Q dies, run this script" that i
missed?

-- 
I use Debian/GNU Linux version 3.0;
Linux boss 2.4.18-bf2.4 #1 Son Apr 14 09:53:28 CEST 2002 i586 unknown
 
DEBIAN NEWBIE TIP #16 from Will Trillich <will@serensoft.com>
:
Why are *.rpm (RED HAT PACKAGES) considered spawn of Satan?
Because the Debian package system is a lot more sophisticated
than the one Red Hat uses; lots more inter-dependency information
is built in to a *.deb package. If you bypass that with an *.rpm
file, you're taking chances with your system. Try to "apt-get
install <debian-only>" packages if possible. (Also check out the
"alien" package if you must.)

Also see http://newbieDoc.sourceForge.net/ ...



Reply to: