Script to give summarized df report (above n% used...)

From: Howie Michalski (s4uhkm@almserv.uucp)
Date: Wed Jan 29 1992 - 15:26:56 CST


I wrote the following script to mail a list of disk stats to me...

#----------------------------------------------------------------------------
#!/bin/csh -f
#
# Used to perform a df of local 4.2 mounts on all servers,
# then mails file to Howie (s4uhkm@sun330)
# (taken from Mike Mohar's code...)
#
#
# Howard Michalski
# January 1992

set allsys= (`cat /home/sysadm/sid_scripts/HOSTS/servers`)

/bin/rm -f /tmp/tmp.df.rpt
/bin/date >/tmp/tmp.df.rpt

foreach d ($allsys)
        echo "" >> /tmp/tmp.df.rpt
        echo -n Disk Report for $d >> /tmp/tmp.df.rpt
        echo : >> /tmp/tmp.df.rpt
        rsh $d df -t 4.2 >> /tmp/tmp.df.rpt
end

/usr/ucb/mail -s "----------Disk Report----------" s4uhkm@sun330 < /tmp/tmp.df.rpt

#----------------------------------------------------------------------------

A sampe of the output...

Disk Report for bach:
Filesystem kbytes used avail capacity Mounted on
/dev/sd0a 14203 10132 2650 79% /
/dev/sd0g 115687 91462 12656 88% /usr
/dev/sd2a 188058 35164 134088 21% /usr/local

Disk Report for brixton:
Filesystem kbytes used avail capacity Mounted on
/dev/sd2a 14983 5969 7515 44% /
/dev/sd2g 322223 129205 160795 45% /usr
/dev/sd3g 275613 7284 240767 3% /home
/dev/sd3h 244808 136901 83426 62% /usr2
/dev/sd2f 183198 80073 84805 49% /var

and so on...
I would like the same report format but I only want to see dev's that are over 70% full.
I think a simiple awk routine would do it but I am pressed for time, and I havent awk`ed
in a good while...

Anyone want to give it a shot???

Thanks in advance!
Howie
s4uhkm@fnma.COM

-- 

*************************************************** *************************************************** **** Howard K Michalski --> s4uhkm@fnma.COM ****



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:06:35 CDT