首页 > 代码库 > 监控系统邮件收敛脚本

监控系统邮件收敛脚本

[root@localhost ~]# vim mon/mail/mail.sh#!/bin/bashlog=$1  t_s=`date +%s`t_s2=`date -d "2 hours ago" +%s`if [ ! -f /tmp/$log ]then    echo $t_s2 > /tmp/$logfit_s2=`tail -1 /tmp/$log|awk {print $1}`echo $t_s>>/tmp/$logv=$[$t_s-$t_s2]    echo $vif [ $v -gt 3600 ]then        /usr/local/php/bin/php ../mail/mail.php "$1 $2" "$3"    echo "0" > /tmp/$log.txtelse        if [ ! -f /tmp/$log.txt ]    then        echo "0" > /tmp/$log.txt    fi    nu=`cat /tmp/$log.txt`    nu2=$[$nu+1]    echo $nu2>/tmp/$log.txt    if [ $nu2 -gt 10 ]        #     then            /usr/local/php/bin/php ../mail/mail.php "trouble continue 10 min $1  $2 " "$3"        echo "0" > /tmp/$log.txt    fi      fi 

 

 

 

 

    

 

 

 

 

 

    

监控系统邮件收敛脚本