• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 186
  • Last Modified:

is there a script in linux to notify that the hard disk space is 95% full.

is there a script in linux to notify that the hard disk space is 95% full.

or has any one written or used something that could let you know when the hard disk space is getting full.

Thanks
0
muthiahmerchant
Asked:
muthiahmerchant
  • 2
1 Solution
 
wnrossCommented:
We've written perl scripts to do this:

open(DC,'df -P --type ext3| awk \'{print $5" "$6}\' |')
        || die "Unable to check diskspace";

# then just scan
while(<DC>) {
  /(\d+)%\s+(.+)/;
  if ($1 > $highwatermark) {
          $alert .= "Overfull alert: $1% $2\n";
  }
}
to loop through the drives and check that the percentages don't exceed our high watermark.

if any do, send me an email and page me.

Cheers,
-Bill
0
 
muthiahmerchantAuthor Commented:
Thanks, will try it and get back to you.
0
 
wnrossCommented:
don't forget to set $highwatermark = 95;
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now