# Diskstat
# Generate disk usage report and mail it in pretty html
# (c)2008 neXt under the terms of GPL v2
#
recipient=service@xxxxxxxx.com, info@xxxxxxxxxxxxxxxxx.com
outfile=”/tmp/diskuse.$$”
echo “” > $outfile
echo “” >> $outfile
echo “
echo “” >> $outfile
echo “” >> $outfile
echo “” >> $outfile
echo “
” >> $outfile” >> $outfile
echo “========================================================================” >> $outfile
echo “Report created on $HOSTNAME at: ” `date` “” >> $outfile
echo “========================================================================” >> $outfile
df -h -T >> $outfile
echo “========================================================================” >> $outfile
du -h –max-depth=1 / >> $outfile
echo “========================================================================” >> $outfile
#smartctl -AH /dev/hda | tail -n22 >> $outfile
smartctl -d cciss,0 -a /dev/cciss/c0d0 | tail -n27 >> $outfile
smartctl -d cciss,0 -a /dev/cciss/c0d1 | tail -n27 >> $outfile
echo “========================================================================” >> $outfile
echo “” >> $outfile
echo “
echo “” >> $outfile
echo “” >> $outfile
/usr/bin/mail -s “$HOSTNAME - disk usage report” $recipient <$outfile rm -f /tmp/diskuse* exit 0
No comments:
Post a Comment