set daemon 60 set logfile syslog facility log_daemon set mailserver localhost set mail-format { from: monit@constantshift.com } set alert email@domain.com set httpd port 2812 and allow 12.34.56.0/24 allow 98.765.43.21 SSL ENABLE PEMFILE /etc/lighttpd/server.pem allow user:password check process lighttpd with pidfile /var/run/lighttpd.pid group http start program = "/etc/init.d/lighttpd start" stop program = "/etc/init.d/lighttpd stop" if failed host 127.0.0.1 port 8080 then restart if cpu > 60% for 2 cycles then alert if cpu > 80% for 5 cycles then restart if totalmem > 200.0 MB for 5 cycles then restart if children > 250 then restart if loadavg(5min) greater than 10 for 8 cycles then stop if failed host 127.0.0.1 port 443 with timeout 15 seconds then restart if 3 restarts within 5 cycles then timeout check process varnish with pidfile /var/run/varnishd.pid start program = "/etc/init.d/varnish start" stop program = "/etc/init.d/varnish stop" if cpu > 60% for 2 cycles then alert if cpu > 80% for 5 cycles then restart if totalmem > 200.0 MB for 5 cycles then restart if children > 250 then restart if loadavg(5min) greater than 10 for 8 cycles then stop if failed host 127.0.0.1 port 80 then restart if 3 restarts within 5 cycles then timeout check process php-fcgi with pidfile /var/run/php-fastcgi.pid group php start program "/etc/init.d/php-fastcgi start" stop program "/etc/init.d/php-fastcgi stop" if failed host 127.0.0.1 port 9000 then restart if 5 restarts within 5 cycles then timeout check process mysql with pidfile /var/run/mysqld/mysqld.pid group database start program = "/etc/init.d/mysql start" stop program = "/etc/init.d/mysql stop" if failed host 127.0.0.1 port 3306 then restart if 5 restarts within 5 cycles then timeout check process sshd with pidfile /var/run/sshd.pid start program "/etc/init.d/ssh start" stop program "/etc/init.d/ssh stop" if failed host 70.32.107.192 port 22 protocol ssh then restart if 5 restarts within 5 cycles then timeout check process sendmail with pidfile /var/run/sendmail/mta/sendmail.pid group mail start program "/etc/init.d/sendmail start" stop program "/etc/init.d/sendmail stop" if failed host 127.0.0.1 port 25 then restart if 5 restarts within 5 cycles then timeout