#! /bin/bash
source /etc/profile
envor="xxxx 环境"
webaddr="https://xxxxx/loginUI.shtml"
tt1=`curl -I -s 'https://xxxxx/loginUI.shtml' | head -1 | cut -d " " -f2`
errtitle=$envor"出现异常"
errinfo=$envor$webaddr" 运行异常"
normalinfo=$envor$webaddr" 运行正常"
if [ $tt1 != "200" ]
then
date >> /var/sh/log.txt
echo $errinfo >> /var/sh/log.txt
echo $errinfo | mail -s $errtitle "test@163.com"
else
date >> /var/sh/log.txt
echo $normalinfo >> /var/sh/log.txt
fi
检查网站是否正常的shell脚本 并发送邮件
最新推荐文章于 2023-04-19 09:07:27 发布