微信消息自动推送

注册企业微信

企业微信地址:https://work.weixin.qq.com

Centos 7 下监控与告警部署

Centos 7 下监控与告警部署

注意:上面我只是做个范例,我实际是有自己的企业微信的,下面的企业微信配置和上面的企业微信名称对不上,不要诧异

 

配置企业微信

Centos 7 下监控与告警部署

Centos 7 下监控与告警部署

Centos 7 下监控与告警部署

Centos 7 下监控与告警部署

 

 Centos 7 下监控与告警部署

 

创建消息应用

Centos 7 下监控与告警部署

Centos 7 下监控与告警部署

Centos 7 下监控与告警部署

 

消息接口检测

应用接口检测地址:https://work.weixin.qq.com/api/devtools/devtool.php

Centos 7 下监控与告警部署

Centos 7 下监控与告警部署

 

创建接口脚本

#!/bin/bash
CropID="ww12214570ab5fbcb9"
Secret="m9ppA-DEVz6O5eP3xp51JSrHuFoyJsR2YDl05KJXJR4"
GURL="https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=$CropID&corpsecret=$Secret"
Gtoken=$(/usr/bin/curl -s -G $GURL | awk -F\" '{    print $10}')
PURL="https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=$Gtoken"
IP=$(curl ip.cip.cc)
/usr/bin/curl --data '{ "touser": "LiangXiao","msgtype": "text","agentid": "1000002","text": {"content": "'$IP'"},"safe":"0"}' $PURL
View Code

相关文章:

  • 2021-11-26
  • 2021-12-15
  • 2021-08-17
  • 2021-05-07
  • 2021-08-19
  • 2021-10-18
  • 2021-09-19
猜你喜欢
  • 2022-12-23
  • 2021-06-14
  • 2021-12-01
  • 2021-12-15
  • 2021-05-14
相关资源
相似解决方案