作者:Sam
grep alertscripts /etc/zabbix/zabbix_server.conf
AlertScriptsPath=/usr/lib/zabbix/alertscripts
下载到server端
chmod 755 wechat.sh
chown zabbix.zabbix wechat.sh
./wechat.sh <corpid> <secretid> <agentid> <你的企业微信用户名> "$(date)"
这些信息都可以在企业微信页面找到
新建“报警媒介类型”为wechat.sh
设置五个参数,分别为:
- corpid
- corpsecret
- agentid
- userid
- message
报警内容可以通过宏来自定义 例如
Problem started at {EVENT.TIME} on {EVENT.DATE}
Problem name: {EVENT.NAME}
Host: {HOST.NAME}
Severity:{TRIGGER.SEVERITY}
Original problem ID: {EVENT.ID}
{TRIGGER.URL}