GithubHelp home page GithubHelp logo

alonl / alertmanagerrocketchat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pavel-kazhavets/alertmanagerrocketchat

0.0 2.0 0.0 8 KB

Integration of Alertmanager notifications in RocketChat

License: MIT License

JavaScript 100.00%

alertmanagerrocketchat's Introduction

AlertmanagerRocketChar

Overview

AlertmanagerIntegration is script that will parse webhook notifications coming to Rocket.Chat.

Installation

Rocket.Chat

  1. Login as admin user and go to: Administration => Integrations => New Integration => Incoming WebHook

  2. Set "Enabled" and "Script Enabled" to "True"

  3. Set all channel, icons, etc. as you need

  4. Paste contents of AlertmanagerIntegrations.js into Script field.

  5. Create Integration. You;ll see some values apper. Copy WebHook URL and proceed to Alertmanager.

Alertmanager

  1. Create new receiver or modify config of existing one. You'll need to add webhooks_config to it. Small example:
route:
    repeat_interval: 30m
    group_interval: 30m
    receiver: 'rocketchat'

receivers:
    - name: 'rocketchat'
      webhook_configs:
          - send_resolved: false
            url: '${WEBHOOK_URL}'
  1. Reload/restart alertmanager.

If everything is OK you should see alerts like this:

alert example

Testing

In order to test the webhook you can use the following curl (replace ):

curl -X POST -H 'Content-Type: application/json' --data '
{
  "text": "Example message",
  "attachments": [
    {
      "title": "Rocket.Chat",
      "title_link": "https://rocket.chat",
      "text": "Rocket.Chat, the best open source chat",
      "image_url": "https://rocket.cha t/images/mockup.png",
      "color": "#764FA5"
    }
  ],
  "status": "firing",
  "alerts": [
    {
      "labels": {
        "alertname": "high_load",
        "instance": "node-exporter:9100"
      },
      "annotations": {
        "description": "node-exporter:9100 of job xxxx is under high load.",
        "severity": "major",
        "summary": "node-exporter:9100 under high load."
      }
    }
  ]
}
' <webhook-url>

NOTES

Alertmanager doesn't actually sends singular alerts - it sends array of current alerts, so it doesn't seem possible for now to split then in separate messages, but if you want, you can configure separate alerts/receivers/webhooks.

Alertmanager Docs

Rocket.Chat Docs

alertmanagerrocketchat's People

Contributors

mikalaisyty avatar pavel-kazhavets avatar simonbin 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.