3
#======================================================================
6
# Simple little script that checks the status of all partitions
7
# on a node's hard disks. It will produce a warning alert and list
8
# the offending filesystems in nagios.
13
# Email: lonny@abyss.za.org
14
# therocker@pawprints.2y.net
15
#=====================================================================
17
NUMBER=`rsh $1 -l root df -kP | grep -v ":" | grep -E "9[0-9]%" | tr -s ' '| cut -d' ' -f5 | cut -c1-2 | line`
21
if [ "$NUMBER" -gt 90 ]
24
`rsh $1 -l root df -kP |grep -v ":" | grep -E "9[0-9]%" | tr -s ' '| cut -d' ' -f6,5 >> $TMPFILE`
26
LINES=`wc -l /tmp/tmp.hndl | cut -c8`
27
LINESCTL=`wc -l /tmp/tmp.hndl | cut -c8 `
28
echo "Filesystems over 90% --> \c"
30
#======================================================================
31
# You'll see this one in a few our shell scripts. Just chcecking for
32
# multiple occurances of the warnign condition. We gotta list 'em all
33
#======================================================================
35
while [ $LINESCTL != 0 ]
38
cat $TMPFILE | tail -$LINESCTL > $TMPTOO
39
cat $TMPTOO > $TMPFILE
40
LINESCTL=$(( $LINESCTL -1 ))
41
LINES=$(( $LINES -1 ))
42
DATA=`head -1 /tmp/tmp.hndl`
49
#===============================================================
50
# Clean up all those nasty tmp files that suck up valuable
52
#===============================================================
60
echo "No Filesystems over 90%... OK"