set daemon 120 with start delay 240 set logfile syslog facility log_daemon
set mailserver localhost
set eventqueue basedir /var/monit slots 100
set mail-format { from: monit@$HOST subject: $SERVICE $EVENT at $DATE message: Monit $ACTION $SERVICE at $DATE on $HOST }
set alert root@localhost set httpd port 4598 and allow monit:monitor
check process apache with pidfile /var/run/apache2.pid group apache start program = "/etc/init.d/apache2 start" with timeout 60 seconds stop program = "/etc/init.d/apache2 stop" if cpu > 70% for 2 cycles then alert if cpu > 90% for 5 cycles then restart if children > 250 then restart if failed host localhost port 80 then restart if 5 restarts within 5 cycles then timeout
check process cron with pidfile /var/run/crond.pid group system start program = "/etc/init.d/cron start" stop program = "/etc/init.d/cron stop" if 5 restarts within 5 cycles then timeout
check process munin-node with pidfile /var/run/munin/munin-node.pid group system start program = "/etc/init.d/munin-node start" stop program = "/etc/init.d/munin-node stop" if failed host localhost port 4949 then restart if 5 restarts within 5 cycles then timeout
check process mysqld 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 group ssh start program = "/etc/init.d/ssh start" stop program = "/etc/init.d/ssh stop" if failed host 127.0.0.1 port 22 protocol ssh then restart if 5 restarts within 5 cycles then timeout
check process proftpd with pidfile /var/run/proftpd.pid start program = "/etc/init.d/proftpd start" stop program = "/etc/init.d/proftpd stop" if failed port 21 protocol ftp then restart if 5 restarts within 5 cycles then timeout
check device sda1 with path /dev/sda1 group system if space usage > 85% then alert if space usage > 90% then alert