标签:利用curl监控web返回状态码监控web service
#/bin/bash # monitoring web is running curl www.163.com -I|awk -F ‘ ‘ ‘{print $2}‘|sed ‘s/[a-zA-Z]//g‘|grep 200 if [ $? == 0 ] then echo "web is running ok" else echo "web is dead"|mail -s "web is not running" 1306xxx@139.com fi
注:只要返回不是200,就会发邮件告警
缺点:如果返回的是301,就会误判
本文出自 “boyhack” 博客,请务必保留此出处http://461205160.blog.51cto.com/274918/1744345
标签:利用curl监控web返回状态码监控web service
原文地址:http://461205160.blog.51cto.com/274918/1744345