目录
2. 安装prometheus-webhook-dingtalk
前言
参考RancherLabs 文章: ( Rancher2.6全新Monitoring快速入门_RancherLabs的博客-CSDN博客
对rancher monitor使用过程中的配置讲解补充,补充了alertmanger发送钉钉告警的实现过程,通过安装dingtalk插件完成钉钉机器人告警推送,详细如下
1. 安装monitor
集群-集群工具Monitoring

根据实际需求修改部署要求:如持久化,数据保存时长等



安装完毕后可在: 集群-监控,查看仪表盘
分别可查看alertmanger、grafana和prometheus web界面

2. 安装prometheus-webhook-dingtalk
2.1 配置钉钉告警配置文件
注意:先创建钉钉机器人,安全验证配置secret,用于下面的配置文件中
创建dingtalk config.yml
# url和secret改为自己的机器人webhook地址和secret
templates:
- /etc/prometheus-webhook-dingtalk/dingding.tmpl
targets:
k8s:
url: https://oapi.dingtalk.com/robot/send?access_token="你的钉钉webhook"
secret: "你的钉钉webhook secret"
message:
title: '{
{ template "ops.title" . }}'
text: '{
{ template "ops.content" . }}'
2.2 创建钉钉告警模板
dingding.tmpl
{
{ define "__subject" }}
[{
{ .Status | toUpper }}{
{ if eq .Status "firing" }}:{
{

本文参考RancherLabs文章,对rancher monitor使用配置进行补充,讲解了alertmanger发送钉钉告警的实现。包括安装monitor、prometheus-webhook-dingtalk,配置钉钉告警相关文件,设置告警接收者和路由,最后进行测试,触发告警可收到邮件和钉钉通知。

1246

被折叠的 条评论
为什么被折叠?



