详情访问b站
结合海螺问问编写shell脚本的zabbix推送个人微信预警_哔哩哔哩_bilibili
用MiniMax 开放平台来提问代码逻辑
并用海螺问问AI生成代码
用pushplus(推送加)-破壳网络科技旗下微信消息推送平台来接入个人微信
- # Zabbix告警信息
- ZABBIX_ALERT_TITLE=$1
- ZABBIX_ALERT_MESSAGE=$3
- ZABBIX_ALERT_SUBJECT=$2
-
- # pushplus配置
- PUSHPLUS_TOKEN="" # 你的pushplus令牌
- PUSHPLUS_CHANNEL="" # 你的pushplus频道
-
- # 构建HTTP请求的body
- BODY="{
- \"token\": \"$PUSHPLUS_TOKEN\",
- \"title\": \"$ZABBIX_ALERT_TITLE\",
- \"content\": \"$ZABBIX_ALERT_SUBJECT \n $ZABBIX_ALERT_MESSAGE \",
- \"template\": \"html\",
- \"topic\": \"$PUSHPLUS_CHANNEL\"
- }"
-
- # 发送HTTP POST请求到pushplus的Webhook接口
- curl -X POST -H "Content-Type: application/json" -d "$BODY" "http://www.pushplus.plus/send"
-
- echo "Zabbix Test Alert has been sent to pushplus."