Giter VIP home page Giter VIP logo

checkmk_telegram_notifications's Introduction

Changes:

Checkmk Telegram Notifications

This is a Checkmk plugin to send notifications via Telegram.

The initial version of this plugin was posted in 2016 on my blog: Monitoring Notifications via Telegram

Download

The latest version can always be found under Releases.

The plugin is also available at Checkmk Exchange but it may take some time to see new releases.

Setup

Sending messages via a Telegram bot requires two pieces of information:

  1. The token of a Telegram Bot to send messages with
  2. The chat id for any user to send notifications to

Telegram Bot

The instructions for talking to BotFather (the Telegram bot used to create a new bot) should be straightforward to follow. The resulting token will be needed for all following steps.

To send messages to a Telegram user, one needs to know the internal chat id for the chat/conversation between the user and the bot.

To find out the chat id, open a private conversation with the bot and send at least one message. Afterwards query the list of incoming messages via the getUpdates function of the Telegram Bot API by fetching https://api.telegram.org/botTOKEN/getUpdates (replacing TOKEN with the actual bot token).

For example using curl and jq (opening the URL in a web browser will work as well):

curl --silent "https://api.telegram.org/bot${TOKEN}/getUpdates" | jq '.result[].message.chat'

Output:

"chat": {
    "id": 144553322,
    "first_name": "Stefan",
    "type": "private"
}

In the above example the chat id would be 144553322.

Notification

With both the bot token as well as the chat id being known one can now create a notification rule in Checkmk.

Checkmk Notification Rule

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.