content:en_us:cg_monitor-disk-space-and-get-alerts

Monitor disk space and get alerts

This guide describes how to monitor disk space and get alerted when a disk reaches a threshold. Step 1: login to your server, edit file /opt/mistio-collectd/collectd.conf and add this at the end of the file:

<Plugin df>
MountPoint "/"
ValuesPercentage true
</Plugin>

Save and exit. This will measure the root filesystem “/” , if you need to monitor another filesystem make sure you specify it there. Example

MountPoint "/opt"

To monitor /opt. You can also specify a Device, example /dev/xvdb1

Device "/dev/xvdb1"

Step 2: restart ClearGLASS collectd root@server:~# /opt/mistio-collectd/collectd.sh restart Step 3: Enter the page for the machine on ClearGLASS, select 'add graph', then 'df' –> 'root' –> then 'percent_bytes'. Choose 'free' and wait a few seconds until the graphs appear. Step 4: You can now set a rule to get alerted. Example if “df percent root free” < 10 then alert

[image]

As soon as the disk gets filled with 90% we receive an alert email

[image]

Instead of receiving an alert we could also add a command to run (eg rm some log files we know that get the disk filled)

content/en_us/cg_monitor-disk-space-and-get-alerts.txt · Last modified: 2018/03/14 12:20 by cjones

Page Tools