wget https://github.com/timonwong/prometheus-webhook-dingtalk/releases/download/v2.0.0/prometheus-webhook-dingtalk-2.0.0.linux-amd64.tar.gz tar xf prometheus-webhook-dingtalk-2.0.0.linux-amd64.tar.gz ln -sv prometheus-webhook-dingtalk-2.0.0.linux-amd64 /opt/prometheus-webhook
mv config.example.yml config.yml //将配置文件重命名 vim config.yml 将钉钉创建机器人的webhook地址与加签秘钥添加进去
vim /usr/lib/systemd/system/prometheus-webhook-dingtalk.service
systemctl restart prometheus-webhook-dingtalk //启动服务 systemctl status prometheus-webhook-dingtalk //查看运行状态 systemctl enable prometheus-webhook-dingtalk //加入开机自启动 ss -lnt //查看端口号
[root@ops prometheus]# systemctl restart prometheus [root@ops prometheus]# systemctl status prometheus [root@ops prometheus]# systemctl restart alertmanager [root@ops prometheus]# systemctl status alertmanager
1、浏览器打开http://localhost:9090/alerts
2、浏览器再打开http://localhost:9093/#/alerts ![image](https://www.www.zyiz.net/i/l/?n=20&i=blog/2413448/202112/2413448-20211211030126785-1369530499.png)
3、最后查看钉钉是否有告警通知