Network

Checkmk x Telegram: notifications, status, fun

Messenger and monitoring go together like butter and bread - and the setup is just as simple

When Checkmk sends notifications, you usually want to receive them immediately - and today, of course, that means on your smartphone or smartwatch. And what's going on there? Messenger. And not infrequently Telegram. With the great open source program Check_MK Telegram Plus you can not only receive notifications, but also call up status and graphs.

A few years ago we showed how to Receive Checkmk notifications manually in Telegram can. But today it is much more convenient, faster, more detailed and more fun. Check_MK Telegram Plus is permanently set up, Checkmk has a suitable notifications rule and Telegram has a chic menu to query the status of hosts and services, for example.

The procedure at a glance:

  • Get API key from Telegram's BotFather
  • Install Check_MK Telegram Plus
  • Activate and test Telegram bot
  • Create Checkmk rule
  • Send test notification
notification on fenix watch.
Notifications via Telegram on the smartwatch ;)

create bot

First you need one api key, which you have your own in the Telegram world Bot gets, which you turn with the Bot Father created.

So search for the BotFather in Telegram and create it via its menu or / newbot create a new bot and click through the wizard.

create telegram bot
Create bot = get API key

You will immediately receive an API key and a link to your bot. Copy the key and switch directly to the new bot.

api key from the botfather.
API key and link to the new bot

Install Checkmk Telegram Plus

Now install Check_MK Telegram Plus – download it first:

wget https://raw.githubusercontent.com/deexno/checkmk-telegram-plus/main/install.sh

Then you run the script with three parameters:

sudo bash install.sh <site-name> <API-Key> <passwort>
also zum Beispiel:
sudo bash install.sh mysite 123ABC123ABC meinpasswort

You can freely choose your password here. This is used to authenticate the bot later.

start bot

Now switch back to your bot in Telegram and start it via the menu or /begin.

telegram bot menu.
The bot's own menu

Now follows the authentication via the menu or /authenticate. After that the bot is ready.

telegram bot options.
The features of the Checkmk Telegram bot

You can now test directly and call up various statuses:

telegram bot status.
State in telegram

Set up notifications

First activate the notifications for the bot itself, via the menu item NOTIFICATION SETTINGS. You can choose between Silent and Loud here, with the latter there are only silent notifications.

telegram-bot-activation.^^
Notifications must be activated in the bot!

Now create a rule in Checkmk in the area Notifications with the "Notification Method" telegramplus. Under Call with the following parameters then you give notifications_loud or notifications_silent on - analogous to the configuration in the bot.

checkmk-telegram-bot-config-dialog.
Notification method with loud or silent messages

You can then send a manual notification for testing: For example, switch to the host overview and select from the menu Commands the point custom notification, activated forced. forced and shipped.

custom notification in checkmk.
To test: send notifications manually

If everything works, you should now get the corresponding notifications in Telegram.

telegram bot notifications.
Notifications in Telegram

More to Telegram and Check mk.

Mirco Lang

Freelance journalist, Sauerland exile, (fairly old) skateboarder, graduate computer scientist, retail salesman, open source nerd, Checkmk handbook writer. Ex-Saturn'ler, Ex-Data-Becker'ler, Ex-BSI'ler. First contact with computers: ca. 1982 - a friend's big brother's C64. If you want to read more about open source, Linux and craft stuff and support Tutonaut here: About Coffee sponsorship via Paypal.I'm always happy. In advance: Thank you! Do not miss: cli.help and VoltAmpereWatt.de. New: Mastodon

2 comments

  1. Thank you very much for your contribution to the CheckMK Telegram Plus Bot! 😄 I sincerely hope that you are satisfied with its performance and that it makes your workflow easier. After all, this is the main goal of this bot! If you or others are interested in additional features for the bot, don't hesitate to contact me on either GitHub or Telegram (@deexno)! Thanks!

    1. Yes, it's going great! Manually retrieving statuses and graphs is particularly helpful. I added an “omd stop” for myself, but I don’t think that would be relevant for many users…

Leave a Comment

Your e-mail address will not be published. Required fields are marked with * marked

This website uses Akismet to reduce spam. Learn more about how your comment data is processed.

Back to Top button
Close

Oops!

Please deactivate your ad blocker.