Skip to content

Instantly share code, notes, and snippets.

@adam12
Created December 13, 2012 23:31
Show Gist options
  • Save adam12/4281092 to your computer and use it in GitHub Desktop.
Save adam12/4281092 to your computer and use it in GitHub Desktop.
Monit Configurations
check process apache with pidfile /var/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 totalmem > 200.0 MB for 5 cycles then restart
if failed host localhost port 80 protocol http then restart
if 3 restarts within 5 cycles then timeout
check process mysql with pidfile /run/mysqld/mysqld.pid
start program = "/etc/init.d/mysql start"
stop program = "/etc/init.d/mysql stop"
if failed host localhost port 3306 protocol mysql then restart
if 5 restarts within 5 cycles then timeout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment