This tutorial, we will be sharing how to integrate Monika with Telegram bots so that when there are Monika incidents or recoveries, you will be notified on your Telegram group.
First, you need a Telegram account. Head over to https://web.telegram.org to create your account. And then, create a new private chat. Search for an account named “BotFather”. After that, do these steps below:
Now the next step is to create a group for the Monika notifications. Create a group in Telegram, and invite your bots into the group. Then, set your bot to be a group administrator.
Now that we have our bot API key and set our bot to be a group administrator, all we need to do is to get the group ID. Invite a new bot to the group called @RawDataBot into your group to get the group ID.
After you have successfully invited the Telegram Bot Raw, you will see the group ID. Save the group ID to somewhere else and don’t forget to kick the Telegram Bot Raw from your group. Now that we have the group ID and bot token, it’s time to integrate it with Monika.
Now that we have our Webhook URL, it’s time to create a configuration called
Let me explain a little bit about this configuration:
notificationsobject. There are 3 properties:
data. Set the
idto any string values, as it is just an identifier. Then, set the
telegramto set the notification channel to Telegram. After that, put your group ID and bot token notifier webhook URL in
bot_tokenkeys in the
Now that we have our configuration ready, it’s time to run it with Monika. Go to the directory where you saved the Monika configuration, and run Monika straight away using
monika -c monika.yml
Congratulations! Now that you have successfully integrated Monika with Telegram, you will be notified if your website is slow or down.
PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.
Copyright © 2022 Hyperjump Tech. All Rights Reserved.