网站down掉后,自动发信的shell
时间:2009-03-23 来源:sjhf
(转载自:http://guoli0813.blog.51cto.com/623863/122114)
我写这个脚本的目的是,当一个网站down掉后,自动给我发信
#!/bin/bash #website test scripts while true;do for cycle_temp in `cat websit_url_links` do if lynx -dump `echo ${cycle_temp}` -accept_all_cookies|grep "true";then echo "The website is running naturally" else echo "${cycle_temp} has been offline please attend it now!">/opt/test.txt mail -v -s "website down mail" [email protected] < /opt/test.txt fi done sleep 2s done websit_url_links的内容: http://www.bizcom.com.cn/test.jsp http://www.cisco-club.com.cn/test.jsp |
相关阅读 更多 +
排行榜 更多 +