Zabbix钉钉告警

  • A+
所属分类:Linux

一.钉钉客户端配置

1.新建钉钉群聊

2.添加自定义机器人

Zabbix钉钉告警

3.复制webhook值一会需要

二. Zabbix配置

tee  /opt/zabbix/share/zabbix/alertscripts/dingding.sh <<-'EOF'
#!/bin/bash
to=$1
subject=$2
text=$3
curl 'xxxxxxxxxx' -H 'Content-Type: application/json' -d '
{"msgtype": "text",
"text": {
"content": "'"$text"'"
},
"at":{
"atMobiles":[
"'"$1"'"
],
"isAtAll":false
}
}'
EOF

添加执行权限
chmod +x dingding.sh

 

avatar

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: