Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Nov 2003 18:46:10 +0100
From:      Alex de Kruijff <freebsd@akruijff.dds.nl>
To:        Sergey 'DoubleF' Zaharchenko <doublef@tele-kom.ru>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: daemon monitoring
Message-ID:  <20031124174610.GA1068@dds.nl>
In-Reply-To: <20031124090229.63963b19.doublef@tele-kom.ru>
References:  <3B75ECFD-1DE6-11D8-A141-000A95DBBE34@mercurycloud.net> <20031123215725.GC557@dds.nl> <98017B2C-1E17-11D8-A141-000A95DBBE34@mercurycloud.net> <20031124011139.GA60027@dds.nl> <20031124090229.63963b19.doublef@tele-kom.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Nov 24, 2003 at 09:02:29AM +0300, Sergey 'DoubleF' Zaharchenko wrote:
> On Mon, 24 Nov 2003 02:11:39 +0100 Alex de Kruijff <freebsd@akruijff.dds.nl> 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
> <which is obviously wrong for your situation, since the "aux"
>  `daemon' is not running>
> $ ps auxc|grep auxc
> <nothing, which is right>
> $

Your ride i forgot that one. I'll give an adjustment:
result=px aux | grep SomeDaemon | grep -v aux | wc -l

-- 
Alex

Articles based on solutions that I use:
http://www.kruijff.org/alex/index.php?dir=docs/FreeBSD/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031124174610.GA1068>