I use monit on my server to monitor apache and mysql running.
Now I want to add an alert if the disk gets too full. I added this for testing in /etc/monit/monitrc
:
check device rootfs with path /dev/md0
if space usage > 10% then alert
I have two partitions I want to check: /
and /var
:
mount
/dev/md0 on / type ext3 (rw)
/dev/md2 on /var type ext3 (rw)
What are useful checks in this configuration apart from diskspace?
There isn't much to do here. Your current check is syntactically correct, but may not be practical. Why do you care if space utilization is greater than 10%??!?
A typical disk check stanza would look like:
That basically will send an email if the drive is more than 80% full. Monit will also let you know once the data usage falls below that level. Also look at the Monit documentation.
Type
monit status
at the command line. Here's what Monit sees about your filesytem: