# Global section

set daemon 60

set httpd port 2812 and
    use address localhost
    allow localhost

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 mailserver your.mail.server port your-port username "user" password "pasw" using tls
# set mail-format { from: monit@yourdomain.bogus }
# set alert destination@yourdomain.bogus

# Monitor

check device rootfs with path /
    if SPACE usage > 75% then alert
    if SPACE usage > 75% for 10 cycles then exec "/usr/sbin/va.disk.space.clean.sh"
    if SPACE usage > 75% for 20 cycles then exec "/sbin/shutdown -r now"

# versione con notifica su Slack
# check device rootfs with path /
#     if SPACE usage > 75% then exec "/usr/bin/va.slack.msg.sh 'spazio su disco residuo inferiore al 25%'"


# Includes

include /etc/monit/conf.d/*
