利用curl监控web返回状态码监控web service
#/bin/bash#monitoringwebisrunningcurlwww.163.com-I|awk-F'''{print$2}'|sed's/[a-zA-Z]//g'|grep200if[$?==0]thenecho"webisrunningok"elseecho"webisdead"|mail-s"webisnotrunning"1306xxx@139.comfi
注:只要返回不是200,就会发邮件告警
缺点:如果返回的是301,就会误判
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。