Linux – Email when Linux server disk is full

disk-space-utilizationlinuxmonitoring

How can I set up an email notification on a Linux server for when a disk/volume exceeds a certain usage quota?

Best Answer

Option 1:
Write a script that runs df, parses the output for the percent utilization & sends an email when it exceeds a given threshold, then run this script from cron.
(If you're feeling lazy you can find a bunch of pre-written scripts by asking The Knower of All Things for Unix Disk space check script.)


Option 2 (The better solution):
Deploy a monitoring system (Nagios, InterMapper, OpenNMS, etc. -- look around here for lots of suggestions & opinions), and configure it to send you a notification when your disks are filling up. While you're at it configure alerts for other stuff you might be concerned about :-)