set daemon 5 # check services at 2-minute intervals with start delay 10 # optional: delay the first check by 4-minutes # (by default check immediately after monit start) set eventqueue basedir /var/monit slots 1000 set mailserver smtp.lemanscorp.com #set alert asedlack@parts-unltd.com #set alert tnelson@parts-unltd.com set logfile syslog facility log_daemon set httpd port 2812 and allow admin:lemansmonit # require user 'admin' with password 'monit' set mail-format { from: stage-monit@parts-unltd.com reply-to: noreply@parts-unltd.com subject: monit alert -- $EVENT $SERVICE message: $EVENT $SERVICE Date: $DATE Action: $ACTION Host: $HOST Description: $DESCRIPTION Yours sincerely, monit } #apache monitoring check process apache2 with pidfile /var/run/apache2/apache2.pid start program = "/usr/sbin/service apache2 start" with timeout 60 seconds stop program = "/usr/sbin/service apache2 stop" if failed host 127.0.0.1 port 80 protocol tcp with timeout 300 seconds # and request "/apc_info.php" with timeout 300 seconds then restart # if 3 restarts within 5 cycles then timeout # depends on apache_bin # group server