每5分钟监控web服务器状态
2011-09-29 15:23
369 查看
# more monotor_www_bbs_webserver.sh
#!/bin/bash
site1=www.sdtest.com
site2=bbs208.sdtest.com
site3=bbs209.sdtest.com
site4=bbs210.sdtest.com
status=200
while :
do
logdate=$(date +%Y'-'%m'-'%d' '%H':'%M':'%S)
for site in $site1 $site2 $site3 $site4;do
status=`curl -s --head http://$site | awk '/HTTP/ {print $2}'`
if [ "$status" == "200" ]
then
echo "$logdate $site is running."
else
echo "$logdate $site seems error and the first stats still is $status"
status=`curl -s --head http://$site | awk '/HTTP/ {print $2}'`
if [ "$status" != "200" ]
then
echo "$logdate $site seems error and the second stats still is $status"
echo "$logdate $site seems error and the second stats still is $status" | mail -s "$site not running,please check "
186*****30@www.com.cn
fi
fi
done
sleep 300
done
# nohup /monotor_www_bbs_webserver.sh &
#!/bin/bash
site1=www.sdtest.com
site2=bbs208.sdtest.com
site3=bbs209.sdtest.com
site4=bbs210.sdtest.com
status=200
while :
do
logdate=$(date +%Y'-'%m'-'%d' '%H':'%M':'%S)
for site in $site1 $site2 $site3 $site4;do
status=`curl -s --head http://$site | awk '/HTTP/ {print $2}'`
if [ "$status" == "200" ]
then
echo "$logdate $site is running."
else
echo "$logdate $site seems error and the first stats still is $status"
status=`curl -s --head http://$site | awk '/HTTP/ {print $2}'`
if [ "$status" != "200" ]
then
echo "$logdate $site seems error and the second stats still is $status"
echo "$logdate $site seems error and the second stats still is $status" | mail -s "$site not running,please check "
186*****30@www.com.cn
fi
fi
done
sleep 300
done
# nohup /monotor_www_bbs_webserver.sh &
相关文章推荐
- keepalived 高可用,监控web服务器状态
- Haproxy做LB负载均衡集群的搭建和配置,可以通过web页面监控web服务器的运行状态
- shell脚本 监控 web服务器状态
- web 服务器监控状态模块权限控制不严格,导致信息泄露
- keepalived:Keepalived的作用是检测web服务器的状态
- Zabbix使用Pycurl模块监控web页面状态
- Web服务器性能监控分析与优化
- wget和curl查看web服务器的状态
- WEB服务(九)网页形式监测apache服务器运行状态(转)
- 利用PHP实现对服务器性能与状态的监控
- 监控HP服务器cpu状态脚本
- Alchemy Eye监控服务器状态并短信到手机
- Larbin 搜索引擎源码赏析——(三)用来反馈爬虫状态微型web服务器
- Nagios监控HP服务器的硬件状态
- Falcon logo Web服务器文件安全监控平台 Falcon
- 用定制的PHP应用程序来获取Web服务器的状态信息
- 运用Zabbix实现内网服务器状态及局域网状况监控(4) —— Zabbix客户端安装
- 如何从命令行实时监控Nginx Web服务器
- Sys.WebForms.PageRequestManagerServerErrorException: 在服务器上处理请求时出现未知错误。服务器返回的状态码为: 500
- 通过监控线程状态来保证socket服务器的稳定运行