网站down掉后,自动发信的shell
生活随笔
收集整理的這篇文章主要介紹了
网站down掉后,自动发信的shell
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
(轉載自:[url]http://guoli0813.blog.51cto.com/623863/122114[/url]) 我寫這個腳本的目的是,當一個網站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]guoli0813@163.com[/email] < /opt/test.txt fi
??????? done
??????? sleep 2s
done websit_url_links的內容:
[url]http://www.bizcom.com.cn/test.jsp[/url]
[url]http://www.cisco-club.com.cn/test.jsp[/url]
#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]guoli0813@163.com[/email] < /opt/test.txt fi
??????? done
??????? sleep 2s
done websit_url_links的內容:
[url]http://www.bizcom.com.cn/test.jsp[/url]
[url]http://www.cisco-club.com.cn/test.jsp[/url]
總結
以上是生活随笔為你收集整理的网站down掉后,自动发信的shell的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 感受冬日和煦的春风。。。
- 下一篇: Fedora 10成功安装KDE4.2正