prometheus-webhook-dingtalk
docker 部署 prometheus-webhook-dingtalk
- 钉钉 token 如下:
https://oapi.dingtalk.com/robot/send?access_token=XXXXXX
- 执行 docker 安装 prometheus-webhook-dingtalk
docker run -d --restart always -p 8060:8060 timonwong/prometheus-webhook-dingtalk:v0.3.0 --ding.profile="webhook-test=https://oapi.dingtalk.com/robot/send?access_token=XXXXXX"
添加钉钉token
3.查看prometheus-webhook-dingtalk容器运行情况
root@test03:/usr/local/alertmanager# docker ps|grep prometheus-webhook-dingtalk
34dcac5e1baf timonwong/prometheus-webhook-dingtalk:v0.3.0 "/bin/prometheus-web…" 16 hours ago Up 16 hours 0.0.0.0:8060->8060/tcp clever_varahamihira
- 下载项目,测试发送
git clone https://github.com/timonwong/prometheus-webhook-dingtalk.git
cd prometheus-webhook-dingtalk
sh examples/send_alerts.sh
修改 send_alerts.sh 发送路径
- 钉钉收到信息
普通运行 prometheus-webhook-dingtalk
# 编译 main.go
cd cmd
go build -o server main.go
# 运行程序,添加 config
./cmd/prometheus-webhook-dingtalk/server --config.file=./config.yml
# 测试钉钉通知
sh examples/send_alerts.sh
参考
prometheus-alertmanager-webhook-for-dingtalk
文档信息
- 本文作者:dzxindex
- 本文链接:https://dzxindex.github.io/2022/01/06/prometheus-webhook-dingtalk/
- 版权声明:自由转载-非商用-非衍生-保持署名(创意共享3.0许可证)