Checking disk space
Here is a quick and dirty diskspace script:
#!/bin/bash
ALERT=70
#ssh 10.61.37.176 df -H > /tmp/df.out
df -Hl > /tmp/df.out
cat /tmp/df.out | grep -vE 'Filesystem|tmpfs|cdrom' \
| awk '{ print $5 " " $1 " " $6 }' | \
while read output ;
do
usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 )
partition=$(echo $output | awk '{ print $3 }' )
if [ $usep -ge $ALERT ]
then
printf "Running out of space on partition %s \t %g \t %s %s\n" \
$partition $usep $(hostname) $(date)
fi
done
Notice the hard coded ALERT level as well as the commented out ssh command.
It needs work, but should show you how little space one has on all mounted drives.
