#!/usr/bin/perl # # Sorry for the simplicity of this script, but as a first submission... # # Emails/Pages me when a filesystem > 90% full $df=`df -lk 2>/dev/null`; $fs=`df -lk 2>/dev/null | grep -v used | cut -d'%' -f2 | grep -v denied`; $full=`df -lk 2>/dev/null | grep -v used | cut -d'%' -f1`; $full =~ s/.*(..\d)$/\1/mg; $fs=~s/\s+/ /g; $full=~s/\s+/ /g; @fs=split(" ",$fs); @full=split(" ",$full); $host=`hostname`; chomp($host); $fs=@fs; chomp($date); while ($fs) {$fs=shift(@fs); $full=shift(@full); chomp($fs); chomp($full); if ($full > 90) {print "Host: $host Filesystem: $fs is ${full}% full!\n"; @chk=grep(/$fs:$full/,@log); undef(@log); $chk=@chk; close(LOG); if ($chk == 0) {`mailx -s "$host:$fs is ${full}%" youremail\@host.com <