您的位置:首页 > 运维架构 > Linux

linux下磁盘报警脚本

2013-12-04 16:43 351 查看
#!/bin/bash
ip='10.0.101.96'
time=`date +%F-%H:%M`
tmpfile=/tmp/disk.txt
mail_address=`xxxxx@163.com`
cipan=`df -h |awk '{print $5}' |sed 's/%//g' | sed -n 5p`
touch /tmp/disk.txt
echo "From :$ip" > $tmpfile
echo "Date time:$time" >> $tmpfile
echo "df :$cipan" >> $tmpfile
if [ $cipan -gt 6 ] ;
then
echo $cipan
fi
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  linux touch