Skip to content

Instantly share code, notes, and snippets.

@Rubentxu
Forked from mikluko/gist:3897117
Created March 12, 2019 10:27
Show Gist options
  • Save Rubentxu/d8557b7f7803e378b3e3bf063b19659c to your computer and use it in GitHub Desktop.
Save Rubentxu/d8557b7f7803e378b3e3bf063b19659c 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