Git Product home page Git Product logo

prometheus_alert_wechat's Introduction

Alertmanager_webhook_wechat

基于Alertmanager的web_hook机制,增加微信告警。

使用方法:

  1. 安装
pip install -r requirements.txt
  1. 配置
cp prom_alert_wechat.conf.sample prom_alert_wechat.conf

编辑prom_alert_wechat.conf文件,填入正确的内容。

  1. 运行receiver,接收来自alertmanager的消息并存入mq。
python3 ./receiver.py

  1. 运行sender,从mq读取告警内容并发送微信。
python3 ./sender.py

运行时若不指定配置文件路径,默认会在脚本所有目录查找配置文件,请先填写完整配置项再次启动。

正常启动后,可通过浏览器访问http://yourip:port/path测试web服务,正常情况下会看到如下信息:

Current your action is 'GET', it's not allow method. Only 'POST' action is allow.

修改Alertmanager的web_hook配置,使其支持本程序,应该像下面的样子:

receivers:
- name: 'yourname'
  webhook_configs:
    - url: http://本程序所在主机IP:端口/alert_to_wechat

如果有触发了告警,请留意微信消息。

prometheus_alert_wechat's People

Contributors

simanchou avatar

Watchers

James Cloos avatar u-kyou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.