## Nginx

#check process nginx with pidfile /var/run/nginx.pid
#start program = "/usr/bin/systemctl start nginx"
#stop program = "/usr/bin/systemctl stop nginx"
#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

## Apache

#check process httpd with pidfile /etc/httpd/run/httpd.pid
#group apache
#start program = "/usr/bin/systemctl start httpd"
#stop program = "/usr/bin/systemctl stop httpd"
#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


## PHP-FPM

#check process php-fpm.www with pidfile /var/run/php-fpm/php-fpm.pid
#  start program = "/usr/bin/systemctl start php-fpm"
#  stop program  = "/usr/bin/systemctl stop php-fpm"
#  if failed host localhost port 80 protocol http
#     and request '/ping'
#     with timeout 20 seconds for 5 cycles
#     then restart
#  if 3 restarts within 5 cycles then timeout
#  depends on nginx


## MySQL

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


## Memcached

#check process memcached with pidfile /var/run/memcached/memcached.pid
#start program = "/usr/bin/systemctl start memcached"
#stop program = "/usr/bin/systemctl stop memcached"
#if failed host 127.0.0.1 port 11211 protocol MEMCACHE then restart
#if cpu > 70% for 2 cycles then alert
#if cpu > 98% for 5 cycles then restart
#if 2 restarts within 3 cycles then timeout