This article explain how to monitor disk space and receive alerts when disks are almost full.

Go to Administration menu and select Category. Add a new category named ‘Disk’ or any name you want (could be ‘HD’). We will need this category later to create filter and monitoring rules.

Go to Administration menu and select Task. Add a new task (click on green ‘+’ icon).

  • Give it a name
  • In SSH section, select authentication method and the host where you want to monitor disk space
  • In Schedule section, select when you want to run this task and the frequency (could be every day starting at midnight and every 5 minutes until 11:55 PM)
  • In Script section, add the following string: /opt/apsolab/latest/bin/ -f / -u 75 -c Disk
  • You can repeat this line in the script section to monitor multiple file systems on the host
  • Save the task

The file is a Perl script. It is using a Perl module located in /opt/apsolab/latest/bin. If you monitor a file system located in a different host, copy the directory /opt/apsolab/latest/bin in this host (make sure SSH user can exec this script). Use -h option to specify where Apsolab-Server is located and make sure port 5472/tcp is open in your firewall and selinux. Use ‘ -help’ to show all script options.

Option ‘-f /’ will monitor the root file system. If you want to monitor /var, use ‘-f /var’. Option ‘-u 75′ will set threshold at 75%. This will create a log entry with ‘Critical’ severity (priority) if disk space usage >= 75%. And option ‘-c Disk’ is for the log category.

Make sure the task is running without error. In the Task window, check the ‘Last run status’. If not 0, click ‘Show logs’ to see stdout and stderr output.

To create alerts, you need monitoring rules and all monitoring rules are based on filter.

  • From Tools menu select ‘Filter Manager’
  • Click ‘New Filter’ and give it a name like: Disk space monitoring
  • Select ‘Category’ tab
  • Click ‘Enable Category Filter’
  • Click ‘Disk’ (or any category you may have specified in the previous step)
  • Select ‘Priority’ tab
  • Click ‘Enable Priority Filter’
  • Click ‘Critical’
  • Click ‘Save Filter’ button on the right side
  • Click ‘Close’ button

If you want to receive alerts by email, make sure you have setup an email address in your account.

Last step, create monitoring schedule.

  • From Administration menu, select ‘Data Monitoring’
  • Click on the green ‘+’ icon to add monitoring schedule
  • Give it a name and select your account
  • In the Schedule section, select when you want to monitor disk space and create alerts
  • In the ‘On Filter Match Action’ section set what to do when a new alert is created. You may want to receive email and stop this monitoring for a while to avoid receive too many alerts
  • In the ‘Filters’ section select the filter you have created in the previous step. Leave matching records to 1 and window size to 0 seconds
  • Save your monitoring schedule

Voilà, it’s done.