Last active
August 29, 2015 13:58
-
-
Save brianjlandau/10323155 to your computer and use it in GitHub Desktop.
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 daemon 120 | |
set logfile /var/log/monit.log | |
set idfile /var/lib/monit/id | |
set statefile /var/lib/monit/state | |
set mailserver localhost | |
set mail-format { from: [email protected] } | |
set eventqueue | |
basedir /var/lib/monit/events | |
slots 100 | |
set alert [email protected] | |
# Enable status reporting for CLI (i.e. `monit status`) | |
set httpd port 2812 and | |
use address localhost | |
allow localhost | |
include /etc/monit/conf.d/enabled/*.conf |
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
check process mysql with pidfile /var/run/mysqld/mysqld.pid | |
start program = "/usr/sbin/service mysql start" | |
stop program = "/usr/sbin/service mysql stop" | |
if failed unixsocket /var/run/mysqld/mysqld.sock then restart | |
if changed pid then alert | |
if total memory > 50% for 5 cycles then restart | |
if total cpu > 80% for 5 cycles then restart | |
if 6 restarts within 26 cycles then alert | |
if 5 restarts within 5 cycles then timeout |
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
check process nginx with pidfile /var/run/nginx.pid | |
start program = "/usr/sbin/service nginx start" | |
stop program = "/usr/sbin/service nginx stop" | |
if failed host localhost port 80 protocol http | |
and request '/' then alert | |
if changed pid then alert | |
if children > 25 then restart | |
if total memory > 60% for 5 cycles then restart | |
if total cpu > 80% for 5 cycles then restart | |
if 6 restarts within 26 cycles then alert | |
if 5 restarts within 5 cycles then timeout |
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
check process sshd with pidfile /var/run/sshd.pid | |
start program = "/usr/sbin/service ssh start" | |
stop program = "/usr/sbin/service ssh stop" | |
if failed port 22 protocol ssh then restart | |
if 5 restarts within 5 cycles then timeout |
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
check system wing | |
if loadavg (1min) > 6 for 5 cycles then alert | |
if loadavg (5min) > 4 for 5 cycles then alert | |
if memory usage > 75% for 5 cycles then alert | |
if swap usage > 75% for 5 cycles then alert | |
if cpu usage (user) > 70% for 5 cycles then alert | |
if cpu usage (system) > 30% for 5 cycles then alert | |
if cpu usage (wait) > 20% for 5 cycles then alert | |
check filesystem root with path / | |
if space usage > 90% for 5 cycles then alert |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment