新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
如何實現(xiàn)檢測網(wǎng)站down掉后自動發(fā)信的shell腳本代碼-創(chuàng)新互聯(lián)
小編給大家分享一下如何實現(xiàn)檢測網(wǎng)站down掉后自動發(fā)信的shell腳本代碼,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!
代碼如下:
#!/bin/bash #website test scripts while true;do for cycle_temp in `cat url_list` 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" reterry123@163.com < /opt/test.txt fi done sleep 2s done
看完了這篇文章,相信你對“如何實現(xiàn)檢測網(wǎng)站down掉后自動發(fā)信的shell腳本代碼”有了一定的了解,如果想了解更多相關(guān)知識,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝各位的閱讀!
分享標(biāo)題:如何實現(xiàn)檢測網(wǎng)站down掉后自動發(fā)信的shell腳本代碼-創(chuàng)新互聯(lián)
瀏覽路徑:http://www.dlmjj.cn/article/jchie.html