echo "">>/tmp/mon.stat.tmp
echo "">>/tmp/mon.stat.tmp
DAY=`date +%Y-%m-%d`
echo "Today is $DAY,now checking the filesystem's space_usage.........">>/tmp/mon.stat.tmp
df -h|grep -v Filesystem|grep -v none>/root/data
echo "=========================================">>/root/mon.stat.tmp
echo "The follwing Filesystem's usage is great 80%">>/root/mon.stat.tmp
echo "=========================================">>/root/mon.stat.tmp
df -h|grep Filesystem>>/root/mon.stat.tmp
cat /root/data | while read check
do
echo $check>tmp.txt
STATUS_OUT=`cat tmp.txt|awk '{print $5}'|sed -n 's/%//gp'`
echo ${check}
echo $STATUS_OUT
if [ $STATUS_OUT -gt 60 ]; then
echo $check>>/root/mon.stat.tmp
fi
done
echo "+++++++++++++++++++++++++++++++++++++++++++++">>/root/mon.stat.tmp
echo "+The filesystem's total space_usage +">>/root/mon.stat.tmp
echo "+++++++++++++++++++++++++++++++++++++++++++++">>/root/mon.stat.tmp
df -h >>/root/mon.stat.tmp
echo "">>/tmp/mon.stat.tmp
DAY=`date +%Y-%m-%d`
echo "Today is $DAY,now checking the filesystem's space_usage.........">>/tmp/mon.stat.tmp
df -h|grep -v Filesystem|grep -v none>/root/data
echo "=========================================">>/root/mon.stat.tmp
echo "The follwing Filesystem's usage is great 80%">>/root/mon.stat.tmp
echo "=========================================">>/root/mon.stat.tmp
df -h|grep Filesystem>>/root/mon.stat.tmp
cat /root/data | while read check
do
echo $check>tmp.txt
STATUS_OUT=`cat tmp.txt|awk '{print $5}'|sed -n 's/%//gp'`
echo ${check}
echo $STATUS_OUT
if [ $STATUS_OUT -gt 60 ]; then
echo $check>>/root/mon.stat.tmp
fi
done
echo "+++++++++++++++++++++++++++++++++++++++++++++">>/root/mon.stat.tmp
echo "+The filesystem's total space_usage +">>/root/mon.stat.tmp
echo "+++++++++++++++++++++++++++++++++++++++++++++">>/root/mon.stat.tmp
df -h >>/root/mon.stat.tmp
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10972173/viewspace-442889/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/10972173/viewspace-442889/