Skip to content

Instantly share code, notes, and snippets.

@dcrec1
Created January 13, 2010 18:01
Show Gist options
  • Save dcrec1/276409 to your computer and use it in GitHub Desktop.
Save dcrec1/276409 to your computer and use it in GitHub Desktop.
set daemon 30
set mailserver localhost
set logfile /var/log/monit.log
set alert labs@gonow.com.br
set httpd port 2812 address localhost
allow localhost
allow <your ip address>
allow <your user-name>:<your password>
check system localhost
if loadavg (1min) > 8 then alert
if loadavg (5min) > 4 then alert
if memory usage > 75% then alert
if cpu usage (user) > 70% for 8 cycles then alert
if cpu usage (system) > 30% for 8 cycles then alert
if cpu usage (wait) > 20% for 8 cycles then alert
check process apache with pidfile /var/run/apache2.pid
start program = "/etc/init.d/apache2 start"
stop program = "/etc/init.d/apache2 stop"
if cpu > 60% for 2 cycles then alert
if cpu > 98% for 5 cycles then restart
if totalmem > 200.0 MB for 5 cycles then alert
if children > 250 then alert
if loadavg(5min) greater than 20 for 8 cycles then alert
if failed port 80 and protocol http for 2 cycles then restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment