Skip to content

Instantly share code, notes, and snippets.

@attackant
Forked from mikluko/gist:3897117
Last active October 13, 2016 16:48
Show Gist options
  • Save attackant/de5685126493de65925b1b76b217ee7e to your computer and use it in GitHub Desktop.
Save attackant/de5685126493de65925b1b76b217ee7e 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 support@mindsharelabs.com but not on { instance }
mail-format {
From: no-reply@EXAMPLE.com
Subject: [$HOST] $EVENT $SERVICE
Message: $DESCRIPTION
$DATE
}
check system www.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
@attackant
Copy link
Author

in /etc/monit/monitrc
sudo monit reload
sudo monit status

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment