【问题标题】:How can I config prometheus alert with line-notify如何使用 line-notify 配置 prometheus 警报
【发布时间】:2018-11-19 10:45:51
【问题描述】:

我试图找到一种方法在我的 prometheus 服务器上向 line-notify 发送警报通知。我检查了 prometheus 上的警报规则配置状态是否正常,并且警报规则可以正常检测事件,这是我用于 alertmanager 的 config.yml

global:
  resolve_timeout: 5m

route:
  receiver: "line-noti"
  # group_by: ['test-node-linux', 'test-node-windows', 'test-container-exporter', 'test-jmx-exporter']
  group_interval: 10s
  repeat_interval: 1m

receivers:
- name: 'line-noti'
  webhook_configs:
  - url: 'https://notify-api.line.me/api/notify'
    send_resolved: true
    http_config:
      bearer_token: [my_token]

但它不会向 line-notify 发送任何消息

我该如何解决这个案子?

【问题讨论】:

    标签: yaml prometheus prometheus-alertmanager


    【解决方案1】:

    接收者名字的问题,你有双引号"。但是,接收者的名称应该是带有单撇号' 或完全不带撇号。

    网址也可以不带撇号。

    试试这个:

    global:
      resolve_timeout: 5m
    
    route:
      receiver: line-noti
      # group_by: ['test-node-linux', 'test-node-windows', 'test-container-exporter', 'test-jmx-exporter']
      group_interval: 10s
      repeat_interval: 1m
    
    receivers:
    - name: line-noti
      webhook_configs:
      - url: https://notify-api.line.me/api/notify
        send_resolved: true
        http_config:
          bearer_token: [my_token]
    

    【讨论】:

    • 我尝试在您的建议中不带撇号('、")的配置,但它不起作用,我的 LINE 通知没有任何通知。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-04-21
    • 1970-01-01
    • 1970-01-01
    • 2021-10-13
    • 2019-07-14
    • 2021-11-22
    • 2019-07-20
    相关资源
    最近更新 更多