set logfile /var/log/monit

## Apache

#check process httpd with pidfile /etc/httpd/run/httpd.pid
#group apache
#start program = "/etc/init.d/httpd start"
#stop program = "/etc/init.d/httpd stop"
#mode active
#if failed host 127.0.0.1 port 80 protocol http
#and request "/monit.html"
#then restart
#if 5 restarts within 5 cycles then timeout


## Nginx

#check process nginx with pidfile /opt/nginx/logs/nginx.pid
#group nginx
#start program = "/etc/init.d/nginx start"
#stop program = "/etc/init.d/nginx stop"
#mode active
#if children > 250 then restart
#if loadavg(5min) greater than 10 for 8 cycles then stop
#if 3 restarts within 5 cycles then timeout


## MySQL

#check process mysqld with pidfile /var/run/mysqld/mysqld.pid
#start program = "/etc/init.d/mysqld start"
#stop program = "/etc/init.d/mysqld stop"
#mode active
#if failed host 127.0.0.1 port 3306 then restart
#if 5 restarts within 5 cycles then timeout
