Last Updated: February 25, 2016
·
1.18K
· vickeeyz

Monit Conf for Various Services

  • /etc/monit/conf.d/services.conf
#Monitoring Nginx
check process nginx with pidfile /var/run/nginx.pid
    start program = "/etc/init.d/nginx start"
    stop program = "/etc/init.d/nginx stop"

#Monitoring Unicorn
check process unicorn
  with pidfile /home/ubuntu/sites/flo/current/tmp/pids/unicorn.pid
  start program = "/etc/init.d/unicorn start"
  stop program = "/etc/init.d/unicorn stop"
  group unicorn

#Monitoring Memcached
check process memcached with pidfile /var/run/memcached.pid
    start program = "/etc/init.d/memcached start"
    stop program = "/etc/init.d/memcached stop"

#Monitoring Postgresql_9.2
check process postgresql9.2 with pidfile /var/lib/postgresql/9.2/main/postmaster.pid
    group database
    start program = "/etc/init.d/postgresql start"
    stop  program = "/etc/init.d/postgresql stop"

#Monitoring MySql
check process mysql with pidfile /var/run/mysqld/mysqld.pid
start program = "/etc/init.d/mysql start"
stop program = "/etc/init.d/mysql stop"

#Monitoring php5-fpm: the parent process.
check process php5-fpm with pidfile /var/run/php5-fpm.pid
  start program = "/etc/init.d/php-fpm start"
  stop program  = "/etc/init.d/php-fpm stop"