Advanced Telegram Plugin - Telegram Plus

Hello community,

I am excited to introduce our new Telegram plugin, developed because we needed more functionality than the current Telegram plugin provided (which is still very good).

We needed to not only receive messages from Check_MK as soon as a problem occurs, but also to interactively ask for more information.

Since this is currently difficult due to the lack of a Check_MK app or a comparably good Nagios app, we developed the following project: GitHub - deexno/checkmk-telegram-plus: This Telegram bot provides an interface to your Check_MK server. It allows you to send automatic error messages (alerts) via Telegram and to manually read out information about hosts and services.

I won’t go into detail on how it works, but anyone interested can check out the details on GitHub.

I want to note that the bot has only been tested for a few weeks and may still have 1-2 bugs. We have not found any bugs so far, but this could vary depending on the environment.

We have also only tested it with Check_MK >2.0, so I cannot guarantee that it will work with older versions. If you would like to test it and give us feedback, we would appreciate it.

I hope you find it useful and enjoyable to use! :slight_smile:

3 Likes

depending on your exact needs, maybe Let's Check an Android/iOS App for Check_MK - #6 by jochum is useful to you?

We have already seen this app and so far it doesn’t have the functionality we want. Furthermore, we now have the opportunity to implement features more quickly, as this project has apparently not been developed further for a long time. (as far as we have seen)

Furthermore, today I implemented the feature that allows you to view graphs via telegram, which means that we can now see just about everything in telegram.

But thanks, let’s wait and see how it develops and then we can always change over. :slight_smile:

Hey @deexno,

I updated “Let’s check” for 2023. Let me know if you need anything, I don’t want to invest to much time into it as long as there’s noone asking for it.

Kind regards,
René

Hi thanks for your offer but we are now well supplied with the Telegram Bot. I will now add that you can reschedule a check via the bot and that you can install it individually for each OMD page, then we will have almost every functionality we need in the bot. :slight_smile:

1 Like

But I should mention that it would be very cool if one day you would fully develop your mobile app so that almost all the functionality is included there. Because I think many of the CheckMK users would need that, and a mobile app can offer some advantages to my bot.

If you require a starting point for functions in the app, you can write to me here via PN, because I could tell you a few things, since we work a lot with CheckMK.

I have now released an update that allows you to run a separate bot per omd page. For those who have already installed the bot, please stop the service, delete the folder where you installed the bot and run the install.sh script as described in the Github repository, this will make future updates easier.

Furthermore, some new functions have been added with this feature.

Thank you

I get this:
Traceback (most recent call last):
File “/omd/sites/tycke/local/share/checkmk-telegram-plus/telegram_bot.py”, line 21, in
from telegram.ext import (
ImportError: cannot import name ‘Application’ from ‘telegram.ext’ (/opt/omd/sites/tycke/local/share/checkmk-telegram-plus/telegram/ext/init.py)

This is probably because you have installed a too old Python library from the python-telegram-bot. (Can have several reasons at first).

I assume you have executed the bot via my install script, so try the following.

  1. Try to run the following command, you should get a similar output.
pip3 show python-telegram-bot

Output:

Name: python-telegram-bot
Version: 20.1
Summary: We have made you a wrapper you can't refuse
Home-page: https://python-telegram-bot.org/
Author: Leandro Toledo
Author-email: devs@python-telegram-bot.org
License: LGPLv3
Location: /usr/local/lib/python3.7/dist-packages
Requires: httpx
Required-by:

If the version in this output is <20.0 execute the following commands in your terminal as root. If this works I will update the install script so that this doesn’t happen anymore. Thanks for your help.

# In your case replace <omd_site_name> with tycke
omd_site=<omd_site_name>

telegram_plus_dir=/omd/sites/$omd_site/local/share/checkmk-telegram-plus
telegram_plus_service_name=checkmk-telegram-plus-$omd_site.service

pip3 install --target=$telegram_plus_dir python-telegram-bot==20.1
pip3 install --target=$telegram_plus_dir python-telegram-bot[job-queue]==20.1
pip3 install --target=$telegram_plus_dir python-telegram-bot[callback-data]==20.1

systemctl restart $telegram_plus_service_name

Keep me posted if this helped, I’ll be happy if we can make the install script work for everyone without any problems :slight_smile:

Got it working finally, after changing to python 3.9 and really remove leftover from previous installs.

All right thank you. Then I’ll check again tomorrow which Python version you need to have installed and set that as a prerequisite in the install script.

I hope you have a lot of fun with the bot and you don’t have any further problems.

If you have other requests or similar you can write to me here via PM. :slight_smile: