Chinaunix首页 | 论坛 | 博客
  • 博客访问: 93619
  • 博文数量: 30
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 305
  • 用 户 组: 普通用户
  • 注册时间: 2014-06-17 11:15
个人简介

面朝大海 春暖花开

文章分类

全部博文(30)

文章存档

2026年(3)

2025年(4)

2024年(2)

2022年(1)

2021年(6)

2016年(1)

2015年(2)

2014年(11)

我的朋友

分类: WINDOWS

2025-04-24 15:05:07

架构
1、下载grafana
grafana-enterprise-11.0.0.windows-amd64.msi
2、下载prometheus
prometheus-2.52.0.windows-amd64.zip
修改配置文件prometheus.yml,假定alertManager安装在本机


3、下载alertmanager
alertmanager-0.28.1.windows-amd64.zip
修改配置文件

  # 分组后发送告警的时间间隔

  group_interval: 5m

  # 发送告警间隔时间 s/m/h,如果指定时间内没有修复,则重新发送告警

  repeat_interval: 1h

修改prometheus.yml配置文件,增加alert配置,并在rules目录下增加报警规则配置文件disk_over.yml
alerting:
  alertmanagers:
    - static_configs:
        - targets:
           - localhost:9093

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
  # - "first_rules.yml"
  # - "second_rules.yml"
  - "rules\\*.yml"



4、安装prometheus+webhook+dingding插件
在https://github.com/timonwong/prometheus-webhook-dingtalk/releases下载

prometheus-webhook-dingtalk-2.1.0.windows-amd64.tar.gz
修改配置文件
这里webhook1的url使用钉钉机器人中配置的webhook url,在机器人配置中说明
5、配置钉钉机器人
群设置-添加机器人-自定义
机器人设置中copy webhook链接,写到prometheus-webhook-dingtalk-2.1.0.windows-amd64的配置文件webhook1的url中
最后启动grafana prometheus alertmanager prometheus-webhook-dingtalk插件,假定windows_exporter已安装在被检测机器且已启动
在grafana上显示

在prometheus上显示
在alertmanager上显示
在钉钉上显示

阅读(438) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~