View Single Post
Old 3rd March 2010, 19:42
K_meleonu K_meleonu is offline
Senior Member
Join Date: May 2006
Posts: 112
Thanks: 1
Thanked 5 Times in 4 Posts

Hi to all,
Solved the last problem with httpd and monit.
because monit does NOT kill all httpd instances and does just a PID kill i have made some modifications to work as it sould.

First of all i have to mention that this tweak is made on a Fedora Release 12.

In /etc/monit.conf i have this:

check process httpd with pidfile /var/run/httpd/
   group www
   start program = "/usr/bin/restart-apache"
   stop program  = "/etc/init.d/httpd stop"
   if failed host port 80 protocol http
      and request "/monit/token" then restart
   if cpu is greater than 50% for 2 cycles then alert
   if cpu > 70% for 5 cycles then restart
   if totalmem > 900 MB for 5 cycles then restart
   if children > 450 then restart
   if loadavg(5min) greater than 10 for 8 cycles then stop
   if 3 restarts within 5 cycles then timeout
/usr/bin/restart-apache has the following inside:
killall -9 /usr/sbin/httpd;
service httpd restart;
Now monit does what i need and work's perfect.

If is there someone with problems i will be glad to help him.
Reply With Quote