# Dinko Korunic, InfoMAR, 2007 set daemon 140 set logfile syslog facility log_daemon set alert neka.adresa@tamo.hr set mailserver 127.0.0.1 set mail-format { from: monit@localhost } check process apache2 with pidfile "/var/run/apache2.pid" start program = "/etc/init.d/apache2 start" stop program = "/etc/init.d/apache2 stop" if failed host 127.0.0.1 port 80 protocol http with timeout 15 seconds then restart if children > 250 then restart if loadavg (5min) > 8 then alert check process tomcat5 with pidfile "/usr/share/tomcat5/temp/tomcat5.pid" start program = "/etc/init.d/tomcat5 start" stop program = "/etc/init.d/tomcat5 stop" if failed host 127.0.0.1 port 8081 protocol http with timeout 15 seconds then restart if children > 250 then restart if loadavg (5min) > 8 then alert check process thttpd with pidfile "/var/run/thttpd.pid" start program = "/etc/init.d/thttpd start" stop program = "/etc/init.d/thttpd stop" if failed host 127.0.0.1 port 80 with timeout 15 seconds then restart if children > 50 then restart check process mysql with pidfile "/var/run/mysqld/mysqld.pid" start program = "/etc/init.d/mysql start" stop program = "/etc/init.d/mysql stop" if failed host 127.0.0.1 port 3306 protocol mysql with timeout 10 seconds then restart check process bind with pidfile "/var/run/bind/run/named.pid" start program = "/etc/init.d/bind9 start" stop program = "/etc/init.d/bind9 stop" if failed host 127.0.0.1 port 53 type tcp then restart if failed host 127.0.0.1 port 53 type udp then restart check process dhcpd with pidfile "/var/run/dhcpd.pid" start program = "/etc/init.d/dhcp3-server start" stop program = "/etc/init.d/dhcp3-server stop" check process postfix with pidfile "/var/spool/postfix/pid/master.pid" group mail start program = "/etc/init.d/postfix start" stop program = "/etc/init.d/postfix stop" if failed host 127.0.0.1 port 25 protocol smtp then restart check process sophie with pidfile "/var/run/sophie/pid" group mail start program = "/etc/init.d/sophie start" stop program = "/etc/init.d/sophie stop" if failed unixsocket "/var/run/sophie/sock" then restart check process clamd with pidfile "/var/run/clamav/clamd.pid" group mail start program = "/etc/init.d/clamav-daemon start" stop program = "/etc/init.d/clamav-daemon stop" if failed unixsocket "/var/run/clamav/clamd.ctl" then restart check process amavisd with pidfile "/var/run/amavis/amavisd.pid" group mail start program = "/etc/init.d/amavis start" stop program = "/etc/init.d/amavis stop" if failed host 127.0.0.1 port 10024 protocol smtp then restart check process openldap with pidfile "/var/run/slapd/slapd.pid" start program = "/etc/init.d/slapd start" stop program = "/etc/init.d/slapd stop" if failed host 127.0.0.1 port 389 protocol ldap3 with timeout 10 seconds then restart if 5 restarts within 5 cycles then timeout check process dovecot with pidfile "/var/run/dovecot/master.pid" group mail start program = "/etc/init.d/dovecot start" stop program = "/etc/init.d/dovecot stop" if failed host 127.0.0.1 port 143 protocol imap then restart if failed host 127.0.0.1 port 110 type tcp then restart check host www.host.tld with address ipaddr alert adresa@negdje.tld if failed icmp type echo count 5 with timeout 15 seconds then alert if failed port 80 protocol http with timeout 15 seconds then alert