#/bin/bash
dk_checkpoint_per=90
dk_checkpoint_num=5.5
echo $dk_checkpoint_num
mount_on='data1'
if df -h |grep $mount_on 2>&1 >/dev/null;then
dk_percent=`df -h |grep $mount_on|awk '{print $5}'|sed 's/%//g'`
dk_unused=`df -h |grep $mount_on|awk '{print $4}'`
else
dk_percent=`df -h|sed -n '2p'|awk '{print $5}'|sed 's/%//g'`
dk_unused=`df -h|sed -n '2p'|awk '{print $4}'`
fi
if `echo $dk_unused|grep 'M'`;then
echo '分区'$mount_on'使用率_'$dk_percent'%剩余'$dk_unused''
exit
else
dk_unused_num=`echo $dk_unused|sed 's/G//'`
fi
echo $dk_percent
echo $dk_checkpoint_per
echo ${dk_unused_num}
if [[ $dk_percent > $dk_checkpoint_per ]] || [[ ${dk_unused_num} < ${dk_checkpoint_mum} ]]; then
echo '分区'$mount_on'使用率_'$dk_percent'%剩余'$dk_unused''
exit
echo wwww
fi
echo kkkkkkkk
阅读(1437) | 评论(0) | 转发(0) |