monit-general
[Top][All Lists]
Advanced

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

Re: Monit newbie with a question...


From: Martin Pala
Subject: Re: Monit newbie with a question...
Date: Thu, 7 Oct 2010 19:52:25 +0200

On Oct 7, 2010, at 1:08 AM, Daniel Waite wrote:

> Hi all. I'm serving web pages with Varnish (no Apache or any other web
> server, just Varnish). I'd like to be notified via e-mail if Varnish
> ever goes down, or, more (less?) specifically, when my website becomes
> unreachable via a browser.
> 
> I've confirmed that Monit is working, at least to some degree, by
> specifying some rules that send me an e-mail when a file's checksum is
> changed.
> 
> However, I'm having difficulty getting Monit to e-mail me about my website.
> 
> Here is the configuration I am using for Monit:
> 
> check process varnishd with pidfile /var/run/varnish.pid
>        start program = "/etc/init.d/varnish start" with timeout 60 seconds
>        stop program = "/etc/init.d/varnish stop"
>        if failed host 127.0.0.1 port 80 protocol http
>                then restart
>        if 3 restarts within 5 cycles then timeout
>        group server
> 
> I am testing this setup by making sure both Varnish and Monit are
> running, and then issuing "service varnish stop". I expect to get an
> e-mail and have Monit attempt to restart Varnish. Neither happen.
> 
> I tested again by using the kill command to kill off Varnish's
> processes, but I still get no e-mail, and Monit doesn't attempt to
> restart Varnish.
> 
> varnishd -V
> varnishd (varnish-2.1.3 SVN 5049:5055)
> Copyright (c) 2006-2009 Linpro AS / Verdens Gang AS
> 
> monit -V
> This is Monit version 5.2
> Copyright (C) 2000-2010 by Tildeslash Ltd. All Rights Reserved.
> 
> uname -a
> Linux wms 2.6.24-23-xen #1 SMP Mon Jan 26 03:09:12 UTC 2009 x86_64
> x86_64 x86_64 GNU/Linux
> 
> ^ CentOS
> 
> Thanks!
> 
> - Daniel

Hi,

i don't know Varnish's architecture ... if it is similar to default Apache 
model, then it may have one parent/master process which spawns child request 
processor threads. The pidfile contains PID of master process - not children.

If you tried to kill such child processes and left master running, then monit 
will still see the process as OK. You'll need to kill the process which's PID 
is in the pidfile:

    kill `cat /var/run/varnish.pid`


Regards,
Martin








reply via email to

[Prev in Thread] Current Thread [Next in Thread]