Skip to content

Instantly share code, notes, and snippets.

@mikluko
Created October 16, 2012 03:37
Show Gist options
  • Save mikluko/3897117 to your computer and use it in GitHub Desktop.
Save mikluko/3897117 to your computer and use it in GitHub Desktop.
Basic monit config to monitor CPU, memory and disk usage
set daemon 30 with start delay 60
set logfile syslog facility log_daemon
set httpd port 2812
allow localhost
set mailserver localhost
set alert alert@example.com but not on { instance }
mail-format {
From: noreply@example.com
Subject: [$HOST] $EVENT $SERVICE
Message: $DESCRIPTION
$DATE
}
check system host.example.com
if loadavg (5min) > 3 for 4 cycles then alert
if loadavg (15min) > 1 for 4 cycles then alert
if memory usage > 80% for 4 cycles then alert
if swap usage > 20% for 4 cycles then alert
if cpu usage (user) > 80% for 4 cycles then alert
if cpu usage (system) > 20% for 4 cycles then alert
if cpu usage (wait) > 20% for 4 cycles then alert
check filesystem "root" with path /dev/sda1
if space usage > 80% for 8 cycles then alert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment