Last active
August 29, 2015 13:57
-
-
Save pawl/9907599 to your computer and use it in GitHub Desktop.
Dallas Makerspace Monit Configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set mailserver localhost | |
# don't alert when pid changed or when monit starts | |
set alert [email protected] but not on { pid, instance } | |
check process apache with pidfile /run/apache2.pid | |
start program = "/etc/init.d/apache2 start" with timeout 60 seconds | |
stop program = "/etc/init.d/apache2 stop" | |
if cpu > 60% for 2 cycles then alert | |
if cpu > 80% for 5 cycles then restart | |
if children > 250 then restart | |
if loadavg(5min) greater than 10 for 8 cycles then stop | |
if 3 restarts within 5 cycles then timeout | |
check process mysqld with pidfile /var/run/mysqld/mysqld.pid | |
group mysql | |
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 failed host 127.0.0.1 port 3306 protocol mysql then alert | |
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 port 22 protocol ssh then restart | |
if 5 restarts within 5 cycles then timeout | |
check system www.dallasmakerspace.org | |
if loadavg (1min) > 4 then exec "/bin/bash -c 'top -bn1 | mail -s top [email protected]'" | |
if loadavg (5min) > 2 then exec "/bin/bash -c 'top -bn1 | mail -s top [email protected]'" | |
if memory usage > 75% then exec "/bin/bash -c 'top -bn1 | mail -s top [email protected]'" | |
if swap usage > 25% then exec "/bin/bash -c 'top -bn1 | mail -s top [email protected]'" | |
if cpu usage (user) > 70% then exec "/bin/bash -c 'top -bn1 | mail -s top [email protected]'" | |
if cpu usage (system) > 30% then exec "/bin/bash -c 'top -bn1 | mail -s top [email protected]'" | |
if cpu usage (wait) > 20% then exec "/bin/bash -c 'top -bn1 | mail -s top [email protected]'" | |
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 port 25 protocol smtp then restart | |
if 5 restarts within 5 cycles then timeout | |
depends on postfix_rc | |
check file postfix_rc with path /etc/init.d/postfix | |
group mail | |
if failed checksum then unmonitor | |
if failed permission 755 then unmonitor | |
if failed uid root then unmonitor | |
if failed gid root then unmonitor | |
# monitor ldap | |
check process slapd with pidfile /var/run/slapd/slapd.pid | |
group database | |
start program = "/etc/init.d/slapd start" | |
stop program = "/etc/init.d/slapd stop" | |
if failed host localhost port 389 protocol ldap3 then restart | |
if 5 restarts within 5 cycles then timeout | |
depends on slapd_bin | |
depends on slapd_rc | |
check file slapd_bin with path /usr/sbin/slapd | |
group database | |
if failed checksum then unmonitor | |
if failed permission 755 then unmonitor | |
if failed uid root then unmonitor | |
if failed gid root then unmonitor | |
check file slapd_rc with path /etc/init.d/slapd | |
group database | |
if failed checksum then unmonitor | |
if failed permission 755 then unmonitor | |
if failed uid root then unmonitor | |
if failed gid root then unmonitor |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment