shell 监控url 地址
[[email protected] opt]# cat web_url.sh
#!/bin/bash
for i in `cat web_url`
do
curl=`curl -I -s $i |head -1|cut -d " " -f2`
if [ "$curl" == "200" ];then
echo curl $i is ok
else
echo "$i is fail" | mail -s "web fail url" [email protected]
fi
done
[[email protected] opt]# cat web_url
http://192.168.0.123:8080/lemon/portal/index.do
http://192.168.0.123:8080/photo/
原文地址:http://blog.51cto.com/innocence/2152879
时间: 2024-10-29 19:10:31