#!/usr/bin/perl open(PIPE, "/bin/df -h|") or die "error spawning df thingy! $!\n"; $alert=0; while() { next unless /%/o; # skip header $l=$_; # preserve $_ chomp; s/%//go; split; $alert=1 if($_[4]>90); } &sendmail if($alert); close(PIPE) or warn "error closing pipe: $!\n"; 0; sub sendmail { open(MAIL, "|/usr/sbin/sendmail admins") or warn "error spawning sendmail! $!\n"; print MAIL<90% full. Have a quick check: `/bin/df` ~Tim EOF close(MAIL) or warn "Error closing mail: $!\n"; }