Skip to content

Instantly share code, notes, and snippets.

@ansrivas
Forked from mikluko/gist:3897117
Created September 12, 2016 13:59
Show Gist options
  • Save ansrivas/2edea6de68f2fcff524c634aa7c54e92 to your computer and use it in GitHub Desktop.
Save ansrivas/2edea6de68f2fcff524c634aa7c54e92 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