如何使用web_hook从promrtheus alertmanager向服务器执行POST Rest API

时间:2018-05-02 10:16:55

标签: prometheus prometheus-alertmanager

我使用alertmanager的以下配置为prometheus发送API post调用但不知何故我无法得到它,下面是我的配置

我的烧瓶服务器在端口9000的localhost上运行,接受POST API调用

global: http_config: 'http://localhost:9000' route: group_by: ['alertname'] group_wait: 30s group_interval: 10s repeat_interval: 10s receiver: test_api routes: - receiver: test_api group_wait: 10s match: infra_grp: pse receivers: - name: "test_api" webhook_configs: send_resolved: true url: '/test/test_host'

1 个答案:

答案 0 :(得分:1)

这是一个无效的配置。删除全局部分并尝试:

 receivers:
 - name: "test_api"  
   webhook_configs:
     send_resolved: true
     url: 'http://localhost:9000/test/test_host'