[Top][All Lists]

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

Re: Monit restarting Apache stops but doesn't start

From: Martin Pala
Subject: Re: Monit restarting Apache stops but doesn't start
Date: Sat, 16 Apr 2011 08:46:06 +0200

You can use the connection test within 'check process' context as well, you just need to add the hostname to the port test otherwise it defaults to localhost:

check process apache with pidfile /var/run/
every 2 cycles
start program = "/etc/init.d/apache2 start" with timeout 60 seconds
stop program = "/etc/init.d/apache2 stop"
if failed host port 80 and protocol http
and request "/login"
with timeout 15 seconds
for 4 cycles
then restart
if 3 restarts within 10 cycles then timeout

=> this will test both the process itself and its tcp port + will be wait for the process to start in case of restart.


On Apr 15, 2011, at 11:33 PM, Jeb Wilkins wrote:


I'm using check host because I'm getting rare hangs where apache still is running but isn't responding to http requests.

After the start command runs apache is still down, its not responding to requests until another cycle restarts it again.



On 15 Apr 2011 21:15, "Martin Pala" <address@hidden> wrote:

Based on the config it seems that the monitored apache runs on the same host (otherwise the start+stop won't be able to do anything with it) => it will be better to switch to "check process" - Monit will be able to check whether the process was started and will wait for the start to finish - the "check host" is remote check which has no control of the remote process, it will call the start script but won't wait for the process to start so you'll see the result during next cycle.


On Apr 13, 2011, at 12:12 PM, Jeb Wilkins wrote:

> I've got the following monit script on an Ubu...

> --
> To unsubscribe:

To unsubscribe:

To unsubscribe:

reply via email to

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