pmm系列~报警~alermanager安装

零 整体调用链
   1 linux安装alertmanager模块 
   2 配置alert.yml 里面主要定义报警级别和相关频率,并填写webhook的api
   3 利用flask框架编写webhook模块,主要包含两方面 1 是各种报警方式 2 是在不同问题级别对报警方式的调用
   4 在prometheus配置文件中进行alert设置绑定
   5 在prometheus容器中进行rule配置
   6 在grafana中进行alert数据源绑定
一 物理机
1 安装alertmanager模块
    2 alert.yml 修改 见后面文章
    3  nohup ./alertmanager --config.file=alert.yml  启动
二  容器内
  1 prometheus.yml
     alerting:
       alertmanagers:
         - static_configs:
         - targets:
            -IP:PORT
      scheme: http
      timeout: 10s
  rule_files:
     - /etc/rules/rules.yml
2 rules.yml的编写 见后面文章
3 需要重启 prometheus
4 报警格式
   报警监控有两种 1 种是自定义的报警格式 flask实现 2另一种是rules的编写规则实现
 

原文地址:https://www.cnblogs.com/danhuangpai/p/13892382.html