Thanks for the reply, I just check the log file and I have the info:

[CEST Jun 27 14:10:48] error    : HTTP error: Server returned status 403
[CEST Jun 27 14:10:48] error    : 'apache' failed protocol test [HTTP] at 
INET[domain1:80] via TCP
[CEST Jun 27 14:10:48] error    : HTTP error: Server returned status 403
[CEST Jun 27 14:10:48] error    : 'apache' failed protocol test [HTTP] at 
INET[domain2:80] via TCP
[CEST Jun 27 14:10:48] error    : HTTP error: Server returned status 403
[CEST Jun 27 14:10:48] error    : 'apache' failed protocol test [HTTP] at 
INET[domain3:80] via TCP

But it will be great to use it on the configuration file. For example: if the 
error is 500 restart, if the error 404 or 403 alert.

Thanks and kind regards.

De: [email protected] 
[mailto:[email protected]] En 
nombre de Martin Pala
Enviado el: lunes, 27 de junio de 2011 15:11
Para: This is the general mailing list for monit
Asunto: Re: Apache error numbers

Hello,

you can find the exact error code which was returned in monit log  with the 
following format:

--8<--
HTTP error: Server returned status <number>
--8<--

Regards,
Martin



On Jun 27, 2011, at 12:24 PM, Josu Lazkano wrote:


Hello all, I am managing a apache server with some vhost, I configured monit 
this way:

check process apache with pidfile /var/run/apache2.pid
   start program = "/etc/init.d/apache2 start"
   stop program  = "/etc/init.d/apache2 stop"
   if failed host domain1 port 80 protocol http and request "/monit/token" then 
alert
   if failed host domain2 port 80 protocol http and request "/monit/token" then 
alert
   if failed host domain3 port 80 protocol http and request "/monit/token" then 
alert
   if cpu is greater than 60% for 2 cycles then alert
   if cpu > 80% for 5 cycles then restart
   if totalmem > 500 MB for 5 cycles then restart
   if children > 250 then restart
   if loadavg(5min) greater than 10 for 8 cycles then stop
   if 3 restarts within 5 cycles then timeout

I have a "/monit/token" file on each site, and when some page is not accessible 
from the machine it sends a alert.

Is it possible to know if the error is 404 or 500?

Thanks and best regards.
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

Reply via email to