Screenshot of diskfree report at admin/reports/status showing Linode disk usage
Screenshot of diskfree alert email showing 47G of free space on the / partition

Get a status report at admin/reports/status and a cron-triggered e-mail warning when locally mounted disk space on your Drupal server reaches a preset threshold.

The alert e-mail uses the following template:

Alert: {hostname} is {percent}% full

Running out of space {mount} ({percent}% used, {space} avail)
on {hostname} for {site_name}

Requires df, grep, and awk to be in the global server $PATH available for PHP to use.

Built for and tested with Debian 6, Ubuntu 12.04, and Mac OSX. Diskfree does not work reliably on Ubuntu 8.04. Most Linux-style environments should work, but only the aforementioned are officially supported.

Diskfree is a component of the classic CIA information security triad: confidentiality, integrity and availability. A full disk partition can halt a web server and cause data corruption. From Wikipedia:

For any information system to serve its purpose, the information must be available when it is needed. This means that the computing systems used to store and process the information, the security controls used to protect it, and the communication channels used to access it must be functioning correctly. High availability systems aim to remain available at all times, preventing service disruptions due to power outages, hardware failures, and system upgrades.

If you prefer, you could also just copy a bash script in your /usr/local/bin and install a crontab to do the same thing, except that it would only alert by email.

Supporting organizations: 

Project information