[Linux-disciples] Notifying when disk space is low

Adam Rosi-Kessel adam at rosi-kessel.org
Sat Apr 22 17:07:20 EDT 2006


Stephen R Laniel wrote:
> I'd like some systems to send me an email whenever their
> amount of free disk space drops below a threshold -- say,
> 10% of the disk's capacity. Right now we do this in a bad
> way: if a program fails because it runs out of disk space,
> we learn about it then. We'd like to be more proactive. What
> sort of tool does one use for this sort of thing?

Perhaps this is more obvious than you're looking for:

if [ `df | grep hda1 | awk ' { print $5 } ' | sed "s/[^0-9]//g"` -lt 10 ]
then
echo LOW DISK SPACE WORKING | mail root
fi

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://lists.bostoncoop.net/pipermail/linux-disciples/attachments/20060422/1d85b245/signature.pgp


More information about the Linux-disciples mailing list