From owner-freebsd-questions@FreeBSD.ORG Sun Nov 23 22:04:05 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1AF5C16A4CE for ; Sun, 23 Nov 2003 22:04:05 -0800 (PST) Received: from mx.tele-kom.ru (mx.tele-kom.ru [213.80.148.6]) by mx1.FreeBSD.org (Postfix) with SMTP id 9498F43FD7 for ; Sun, 23 Nov 2003 22:04:02 -0800 (PST) (envelope-from doublef@tele-kom.ru) Received: (qmail 57304 invoked by uid 555); 24 Nov 2003 09:04:00 +0300 Received: from hal.localdomain (213.80.149.221) by t-k.ru with TeleMail/2 id 1069653839-57282 for freebsd@akruijff.dds.nl; Mon, 24 Nov 09:03:59 2003 +0300 (MSK) Date: Mon, 24 Nov 2003 09:02:29 +0300 From: Sergey 'DoubleF' Zaharchenko To: Alex de Kruijff Message-Id: <20031124090229.63963b19.doublef@tele-kom.ru> In-Reply-To: <20031124011139.GA60027@dds.nl> References: <3B75ECFD-1DE6-11D8-A141-000A95DBBE34@mercurycloud.net> <20031123215725.GC557@dds.nl> <98017B2C-1E17-11D8-A141-000A95DBBE34@mercurycloud.net> <20031124011139.GA60027@dds.nl> X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i386-portbld-freebsd4.8) Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="pgp-sha1"; boundary="Signature=_Mon__24_Nov_2003_09_02_29_+0300_mfiw+0I+BfNMh0kR" cc: Will Prater cc: freebsd-questions@FreeBSD.ORG Subject: Re: daemon monitoring X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Nov 2003 06:04:05 -0000 --Signature=_Mon__24_Nov_2003_09_02_29_+0300_mfiw+0I+BfNMh0kR Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: 7bit On Mon, 24 Nov 2003 02:11:39 +0100 Alex de Kruijff probably wrote: > Dear Will, > > I've moved you text to the buttom so its more readable for other. > > On Sun, Nov 23, 2003 at 04:46:09PM -0800, Will Prater wrote: > > On Nov 23, 2003, at 1:57 PM, Alex de Kruijff wrote: > > >On Sun, Nov 23, 2003 at 10:52:48AM -0800, Will Prater wrote: > > >>List, > > >> > > >>What are most of you using to monitor the running daemons? I have been > > >>loooking into DJB daemontools which seems appropriate, but are there > > >>any others that you reccomend? > > >> > > >>If DJB's daemontools is the one, could I get some more examples? I am > > >>primarily trying to keep my mail system online: postfix, cyrus, > > >>saslauthd, mysql, and spamassassin. > > > > > >I would advise Nagios. > > > > Sorry, I mispoke. I will be using Nagios to monitor, but I need to make > > sure they will restart if there is an error. Will nagios do this as > > well? > > > I don't *think* so. > > You could write a sh script (or any other) that does this. It could > contain this line: > result=px aux | grep SomeDaemon | wc -l > > If the result is zero than SomeDaemon is not running. You'd be better off using "ps auxc" here (that is, print only argv[0]): $ ps aux|grep aux df 642 0,0 0,4 648 444 p1 R+ 8:49 0:00,00 grep aux (sh) df 641 0,0 0,3 516 392 p1 R+ 8:49 0:00,00 ps aux $ ps auxc|grep auxc $ And even a better solution would be to pipe the ps output to a [your favorite scripting language] script to take only the name part of the output (to avoid clash with usernames/etc.). > > > -- > Alex > > Articles based on solutions that I use: > http://www.kruijff.org/alex/index.php?dir=docs/FreeBSD/ > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > -- DoubleF There is a Massachusetts law requiring all dogs to have their hind legs tied during the month of April. --Signature=_Mon__24_Nov_2003_09_02_29_+0300_mfiw+0I+BfNMh0kR Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/wZ8Awo7hT/9lVdwRAlTmAJ9CET4VeM8glKLvaKflanLaSPFEAACeOeEZ 36TdXJ0/x5ke7yPZMxOCSj0= =5/Av -----END PGP SIGNATURE----- --Signature=_Mon__24_Nov_2003_09_02_29_+0300_mfiw+0I+BfNMh0kR--