1.企业微信群机器人

#!/bin/bash
while true
do
    for i in `cat services_list`
    do
http_code=`curl -I -o /dev/null -m 2 -s -w %{http_code} $i`
if [[ $http_code -ne 200 && $http_code -ne 302 ]]
then
date
echo "$i is down"
curl 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=34ni6935-9m1a-4shi9-a3321-dc2sbd4766c4' \
   -H 'Content-Type: application/json' \
   -d '
{
    "msgtype": "markdown",
    "markdown": {
        "content": "<font color=\"warning\">'$i'</font>服务状态返回异常,请快速检查!!"
    }
}'
fi
    done
    sleep 30
done
~                                                                                                                                                      
~                                                                                                                                                      ~                         

 

相关文章:

  • 2021-11-21
  • 2021-08-12
  • 2021-12-02
  • 2022-12-23
  • 2021-11-30
  • 2021-11-29
  • 2021-11-26
  • 2022-03-10
猜你喜欢
  • 2021-07-12
  • 2021-12-29
  • 2022-12-23
  • 2021-12-03
  • 2022-01-06
  • 2021-11-24
相关资源
相似解决方案