大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
[root@webmonitor shell]# cat phpmailmonitor.sh
#!/bin/sh
# FileName: phpmailmonitor.sh
# Date: 2010-11-02
# Author: chenhc
# Description: curl number and compare
# Version 1.0
# ep:./phpmailmonitor.sh
#####
contactphone="1345558021,12220550726"
code=`curl 'http://trader.gate.com/tools/pd/263smtpcheck/monitor.php'`
waiting=`echo $code|awk -F '1,' '{print $2}'|awk '{print $1}'`
sending=`echo $code|awk -F '2,' '{print $2}'|awk '{print $1}'`
fail=`echo $code|awk -F '4,' '{print $2}'|awk '{print $1}'`
lastfail=`cat /tmp/lastfail`
echo "waiting=$waiting"
echo "sending=$sending"
echo "fail=$fail"
专注于为中小企业提供网站设计制作、成都网站设计服务,电脑端+手机端+微信端的三站合一,更高效的管理,为中小企业溧水免费做网站提供优质的服务。我们立足成都,凝聚了一批互联网行业人才,有力地推动了1000+企业的稳健成长,帮助中小企业通过网站建设实现规模扩充和转变。
check_null()
{
if [ -z "$1" ];then
wget --output-document=/dev/null "http://124.4.15.208/message.php?phone=$contactphone&msg=Lv.2 phpmailmonitor.sh exception`date +%k:%M`"
exit 1;
fi
}
check_null $code
check_null $waiting
check_null $fail
#if [ $waiting -gt 2000 ];then
# wget --output-document=/dev/null "http://124.4.15.208/message.php?phone=$contactphone&msg=Lv.2 $waiting mail is waiting sms from 200.6 phpmailmonitor.sh`date +%k:%M`"
#fi
echo "${lastfail}"
increasment=$((${fail}-${lastfail}))
echo $fail>/tmp/lastfail
if [ $increasment -gt 500 ];then
wget --output-document=/dev/null "http://124.4.15.208/message.php?phone=$contactphone&msg=Lv.2 $increasment mail fail sms from 200.6 phpmailmonitor.sh`date +%k:%M`"
fi