Git Product home page Git Product logo

alertmanager-webhook's Introduction

Alertmanager Webhook to Line Notify

image

how to use

Run it by docker

docker run \
  -p 3000:3000 \
  -e LINENOTIFY_ENDPOINT=${LINENOTIFY_ENDPOINT} \
  -e LINENOTIFY_TOKEN=${LINENOTIFY_TOKEN} \
  -e TYPE=lineNotify \
  bibbynet/alertmanager-webhook:1.0

Test it with cURL.

curl --location --request POST 'http://localhost:3000/api/webhook/alert' \
--header 'Content-Type: application/json' \
--data-raw '{
    "version": "4",
    "alerts": [
        {
            "status": "firing",
            "labels": {
                "alertname": "test-webhook",
                "severity": "Warning"
            },
            "annotations": {
                "Threshold": "<= 2",
                "dashboard": "test-dashboard",
                "description": "test description",
                "infoURL": "test-infoURL",
                "summary": "this is a test summary",
                "value": "2"
            }
        }
    ]
}'

docker compose setting

version: "3.3"

services:
  alertmanager-webhook:
    image: bibbynet/alertmanager-webhook:1.0
    restart: always
    ports:
      - "3000:3000"
    environment:
      - LINENOTIFY_ENDPOINT=${LINENOTIFY_ENDPOINT}
      - LINENOTIFY_TOKEN=${LINENOTIFY_TOKEN}
      - TYPE=lineNotify

kubernetes setting

apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    ann: alertmanager-webhook-ann
  labels:
    app: api-lab
    lab: alertmanager-webhook-lab
  name: prod-api-deployment
  namespace: alertmanager-webhook-prod
spec:
  replicas: 2
  selector:
    matchLabels:
      app: api-pod
      lab: alertmanager-webhook-lab
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      annotations:
        ann: alertmanager-webhook-ann
      labels:
        app: api-pod
        lab: alertmanager-webhook-lab
    spec:
      containers:
        - env:
            - name: TYPE
              value: lineNotify
            - name: LINENOTIFY_ENDPOINT
              value: ${LINENOTIFY_ENDPOINT}
            - name: LINENOTIFY_TOKEN
              value: ${LINENOTIFY_TOKEN}
          image: bibbynet/alertmanager-webhook:1.0
          imagePullPolicy: Always
          livenessProbe:
            failureThreshold: 10
            httpGet:
              path: /api/a/healthz
              port: 3000
            initialDelaySeconds: 30
            periodSeconds: 20
            successThreshold: 1
            timeoutSeconds: 10
          name: app
          ports:
            - containerPort: 3000
              name: app3000
          readinessProbe:
            failureThreshold: 10
            httpGet:
              path: /api/a/healthz
              port: 3000
            initialDelaySeconds: 30
            periodSeconds: 20
            successThreshold: 1
            timeoutSeconds: 10
          resources:
            limits:
              cpu: 256m
              memory: 256Mi
            requests:
              cpu: 128m
              memory: 128Mi
      restartPolicy: Always

line notify

https://notify-bot.line.me/en/

inspiration

https://github.com/DRuggeri/alertmanager_gotify_bridge

https://github.com/nontster/line-notify-gateway

alertmanager-webhook's People

Contributors

bibbychung avatar

Stargazers

 avatar

Watchers

 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.