| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Stop wasting time looking for files and revisions! Dokkio, a new product from the PBworks team, integrates and organizes your Drive, Dropbox, Box, Slack and Gmail files. Sign up for free.

View
 

Monit Directive Examples

Page history last edited by Elizabeth Leddy 10 years, 4 months ago

# alert me when things start to look fishy

check system xxx.com

    if loadavg (1min) > 4 then alert

    if loadavg (5min) > 4 then alert

    if memory usage > 87% then alert

    if cpu usage (user) > 70% then alert

    if cpu usage (system) > 40% then alert

    if cpu usage (wait) > 45% then alert

 

# Check the disk usage on root

check device rootfs with path /

  if space usage > 90% then alert

  if space usage > 99% then exec "/srv/web/... .../maintenance_redirect offline"

 

# make sure there is log space

check device san_log_mnt  with path /mnt/san-logs/

  if space usage > 90% then alert

  if space usage > 99% then exec "/srv/web/... .../maintenance_redirect offline"

 

 

# zeo should always be running

check process zeo0 with pidfile /srv/web/... .../var/ZEO.pid

   start program = "/etc/init.d/zeo0 start" with timeout 80 seconds

   stop program = "/etc/init.d/zeo0 stop"

   if failed host 127.0.1.1 port 8101 timeout 60 seconds then restart

 

 

check process zope0 with pidfile /var/run/zope0.pid

    start program = "/etc/init.d/zope0 start" with timeout 80 seconds

    stop program  = "/etc/init.d/zope0 stop"

    if failed host 127.0.1.1 port 8080 protocol HTTP timeout 120 seconds then alert

    if failed host 127.0.1.1 port 8080 protocol HTTP timeout 300 seconds then restart

    if cpu > 70% for 3 cycles then alert

    if totalmem > 2000.0 MB for 5 cycles then alert 

    if loadavg(5min) greater than 10 for 8 cycles then alert

    if 3 restarts within 5 cycles then timeout

 

 

check process varnishd with pidfile /mnt/san-logs/... .../varnish/varnish.pid

    start program = "/etc/init.d/varnishd start" with timeout 60 seconds

    stop program  = "/etc/init.d/varnishd stop"

    if cpu > 60% for 2 cycles then alert

    if cpu > 90% for 5 cycles then alert

    if totalmem > 500.0 MB for 5 cycles then alert

    if children > 250 then alert

    if loadavg(5min) greater than 10 for 8 cycles then alert

check process httpd with pidfile /var/run/httpd.pid

    start program = "/etc/init.d/httpd start" with timeout 60 seconds

    stop program  = "/etc/init.d/httpd stop"

    if cpu > 60% for 2 cycles then alert

    if cpu > 90% for 5 cycles then alert

    if totalmem > 500.0 MB for 5 cycles then alert 

    if children > 250 then alert

    if loadavg(5min) greater than 10 for 8 cycles then alert

Comments (0)

You don't have permission to comment on this page.