Code Monkey home page Code Monkey logo

wxwork-webhook's Introduction

wxwork-webhook

alertmanager webhook for wechat

build image

docker build -t IMAGE_NAME:TAG .

quick start

run wxwork-webhook in docker

docker run -d \
           --restart=on-failure:5 \
           -p 5233:5233 \
           -w /usr/local/wxwork-webhook/
           IMAGE_NAME:TAG \
           python \
           app.py \
           --wxwork-webhook https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxxxxx \
           --listen 0.0.0.0 \
           --port 5233

config alertmanager configuration yaml

add receivers and route receiver

global:
  ...
receivers:
- name: "null"
- name: "wxwork-webhook"
  webhook_configs:
    - send_resolved: true
      url: "http://<YOUR wxwork-webhook IP address>:5233/webhook"
route:
  ...
  receiver: "wxwork-webhook"
  ...

alertmanager webhook json payload

{
  "receiver":"wxwork",
  "status":"firing",
  "alerts":[
    {
      "status":"firing",
      "labels":{
        "alertname":"KubeletDown",
        "prometheus":"monitoring/k8s",
        "severity":"critical"
      },
      "annotations":{
        "message":"Kubelet has disappeared from Prometheus target discovery.",
        "runbook_url":"https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-kubeletdown"
      },
      "startsAt":"2019-08-12T04:12:17.64901609Z",
      "endsAt":"0001-01-01T00:00:00Z",
      "generatorURL":"http://prometheus-k8s-0:9090/graph?g0.expr=absent%28up%7Bjob%3D%22kubelet%22%7D+%3D%3D+1%29&g0.tab=1"
    }
  ],
  "groupLabels":{
    "alertname":"KubeletDown"
  },
  "commonLabels":{
    "alertname":"KubeletDown",
    "prometheus":"monitoring/k8s",
    "severity":"critical"
  },
  "commonAnnotations":{
    "message":"Kubelet has disappeared from Prometheus target discovery.",
    "runbook_url":"https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-kubeletdown"
  },
  "externalURL":"http://alertmanager-main-0:9093",
  "version":"4",
  "groupKey":"{}:{alertname='KubeletDown'}"
}

webhook post json payload

# Alertmanager告警提示
告警内容: **KubeletDown**
[来源URL](http://alertmanager-main-0:9093)


**Labels**

> alertname = KubeletDown
> prometheus = monitoring/k8s
> severity = critical

**Annotations**
> message = msg.annotations_message

screen

wxwork-webhook's People

Contributors

luanlengli 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.