檢測網(wǎng)站down掉后自動發(fā)信的shell腳本代碼
更新時間:2013年02月25日 15:14:15 作者:
腳本用途:檢測指定文件中的網(wǎng)站url,當一個網(wǎng)站down掉后,自動給指定的郵箱發(fā)信
復制代碼 代碼如下:
#!/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
相關(guān)文章
bash腳本如何監(jiān)控cup/內(nèi)存/磁盤使用率
本文主要介紹了bash腳本如何監(jiān)控cup/內(nèi)存/磁盤使用率,文中通過示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下2021-10-10
shell腳本學習指南[五](Arnold Robbins & Nelson H
這篇文章主要介紹了shell腳本學習指南[五](Arnold Robbins & Nelson H.F. Beebe著),需要的朋友可以參考下2014-02-02

