This is a simple script that will emit a warning to stderr when your disk usage surpasses a configured threshold. StdErr output was chosen for its simplicity, and because it's very easy to configure a cron job to send you an email any time an error occurs.
As mentioned, the easiest way to use this script is with Crontabs. By default, cron jobs will send you an email any time a script outputs to stdout or stderr. Since this script will output lots of information onto stdout, and only output to stderr when a disk has become full, it's useful to redirect stdout to /dev/null, like so: