Revision [3808]
Last edited on 2010-08-25 01:14:54 by KenFongAdditions:
if totalmem > 90% for 2 cycles then restart
if loadavg(5min) > 20 for 2 cycles then restart
====Note====
Sometimes monit acts weird, like when it starts it doesn't start up all services. Or it starts and certain service are started in not monitored state. I haven't figured out that yet but running **monit validate all** and **monit monitor all** seems to be helpful in those situations.
if loadavg(5min) > 20 for 2 cycles then restart
====Note====
Sometimes monit acts weird, like when it starts it doesn't start up all services. Or it starts and certain service are started in not monitored state. I haven't figured out that yet but running **monit validate all** and **monit monitor all** seems to be helpful in those situations.
Revision [2264]
Edited on 2009-04-03 06:36:24 by WikiAdminAdditions:
protocol HTTP request / then restart
===Restart apache with monit===
This could be useful if apache (or most likely crappy php code) is not cleaning up
check process apache
with pidfile "/usr/local/apache/logs/httpd.pid"
start program = "/etc/init.d/httpd start" with timeout 60 seconds
stop program = "/etc/init.d/httpd stop"
if 2 restarts within 3 cycles then timeout
if totalmem > 100 Mb then alert
if children > 255 for 5 cycles then stop
if cpu usage > 95% for 3 cycles then restart
if failed port 80 protocol http then restart
group server
depends on httpd.conf, httpd.bin
Ref: http://mmonit.com/monit/documentation/monit.html#examples
===Restart apache with monit===
This could be useful if apache (or most likely crappy php code) is not cleaning up
check process apache
with pidfile "/usr/local/apache/logs/httpd.pid"
start program = "/etc/init.d/httpd start" with timeout 60 seconds
stop program = "/etc/init.d/httpd stop"
if 2 restarts within 3 cycles then timeout
if totalmem > 100 Mb then alert
if children > 255 for 5 cycles then stop
if cpu usage > 95% for 3 cycles then restart
if failed port 80 protocol http then restart
group server
depends on httpd.conf, httpd.bin
Ref: http://mmonit.com/monit/documentation/monit.html#examples