Skip to content

Instantly share code, notes, and snippets.

@johanburati
Last active September 12, 2018 05:30
Show Gist options
  • Save johanburati/6a9bc29a05573d4ec8768a586413d112 to your computer and use it in GitHub Desktop.
Save johanburati/6a9bc29a05573d4ec8768a586413d112 to your computer and use it in GitHub Desktop.
monit basic config
set daemon 60
set logfile /var/log/monit.log
set idfile /var/lib/monit/id
set statefile /var/lib/monit/state
set eventqueue
basedir /var/lib/monit/events
slots 100
set httpd port 2812
allow monit:monit read-only
check system localhost
if loadavg (1min) > 10 then exec "/bin/bash -c '/bin/ps aux > /tmp/ps.$(date +%Y%m%d%H%M%S)'"
if loadavg (5min) > 8 then exec "/bin/bash -c '/bin/ps aux > /tmp/ps.$(date +%Y%m%d%H%M%S)'"
if memory usage > 80% then exec "/bin/bash -c '/bin/ps aux > /tmp/ps.$(date +%Y%m%d%H%M%S)'"
if cpu usage (user) > 10% then exec "/bin/bash -c '/bin/ps aux > /tmp/ps.$(date +%Y%m%d%H%M%S)'"
if cpu usage (system) > 10% then exec "/bin/bash -c '/bin/ps aux > /tmp/ps.$(date +%Y%m%d%H%M%S)'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment