tomcat状态监测脚本-创新互联
tar zxvf heirloom-mailx_12.5.orig.tar.gz
创新互联专注为客户提供全方位的互联网综合服务,包含不限于网站设计制作、做网站、农安网络推广、成都微信小程序、农安网络营销、农安企业策划、农安品牌公关、搜索引擎seo、人物专访、企业宣传片、企业代运营等,从售前售中售后,我们都将竭诚为您服务,您的肯定,是我们大的嘉奖;创新互联为所有大学生创业者提供农安建站搭建服务,24小时服务热线:028-86922220,官方网址:www.cdcxhl.comcd heirloom-mailx-12.5/
make && make install UCBINSTALL=/usr/bin/install
cp /etc/nail.rc /etc/nail.rc.bak
vim /etc/nail.rc
set from=xxx@126.com 发送邮箱
set smtp=smtp.126.com 发送邮箱smtp地址
set smtp-auth-user=xxx@126.com 接收邮箱
set smtp-auth-password=xxx 邮箱密码
set smtp-auth=login
echo 123 | mailx -v -s "zabbix test mail" xxx@126.com
com
-bash: echp: command not found
Resolving host smtp.126.com . . . done.
Connecting to 220.181.15.111:25 . . . connected.
220 126.com Anti-spam GT for Coremail System (126com[20140526])
>>> EHLO vm172-18-0-18.ksc.com
250-mail
250-PIPELINING
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250-coremail 1Uxr2xKj7kG0xkI17xGrU7I0s8FY2U3Uj8Cz28x1UUUUU7Ic2I0Y2UFhQBZHUCa0xDrUUUUj
250-STARTTLS
250 8BITMIME
>>> AUTH LOGIN
334 dXNlcm5hbWU6
>>> d3loMTk4NzI1QDEyNi5jb20=
334 UGFzc3dvcmQ6
>>> V1lIMTk4NzI1IUAj
235 Authentication successful
>>> MAIL FROM:
250 Mail OK
>>> RCPT TO:
250 Mail OK
>>> DATA
354 End data with
>>> .
250 Mail OK queued as smtp1,C8mowABnDOoAivZZ4IC0AQ--.8734S2 1509329409
>>> QUIT
221 Bye
touch /root/health_crm.sh
touch /tmp/health_crm/health_crm.log
vim /root/health_crm.sh
#!/bin/bash
set i=10
while true
do
let "i=i+10"
response=`curl --silent http://xx.com/ -i|egrep "HTTP/1.1" |awk -F ' ' '{print $2}'`
code=`curl --silent http://xxx.com/ >> /tmp/health_tomcat/health_crm.log`
if [ $response != 200 ]
then
echo "$response" |mail -s "your website is not ok now!" xx@xx.com
else
curl --silent http://xx.com/ >> /tmp/health_crm/health_crm.log
sleep 300
fi
done
#done
crontab -e
5 * * * * root /bin/sh /root/health_crm.sh
service crond restart && service ntpd restart
另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
网站标题:tomcat状态监测脚本-创新互联
转载源于:http://scyanting.com/article/dejdio.html