You are here: Home > Products > Network Monitor (Pro) > User Manual > How to Configure Receiving Monitoring Notifications in Telegram

How to Configure Receiving Monitoring Notifications in Telegram

This article describes how to create a Telegram bot and set up receiving notifications from host monitoring checks in the messenger. This way, you can receive alerts on your smartphone and any other devices over the Internet.

1. Creating a chatbot and getting a token in Telegram

First, you need to create a chatbot in Telegram and get its token:

  1. Open Telegram and search for the BotFather bot (@BotFather).
  2. Start a conversation with BotFather by clicking the Start
  3. button
  4. Enter the command /newbot to create a new bot. (Or choose from the list).
  5. BotFather will ask you to enter the bot name (for example, MyTestBot). This name will be displayed in contacts
  6. Then you need to enter the bot username. It must end with bot (for example, MyTestBot_bot).

After successfully creating the bot, BotFather will provide you with its token (for example, 123456789:ABCdefGhIJKlmNoPQRstuVWXyz).

2. Getting the chat ID

To receive notifications in the Telegram messenger, you also need to know the chat ID. Here's how to get it:

  1. Send a message to your bot.
  2. Next, you'll need to follow the link: https://api.telegram.org/bot<YourBotToken>/getUpdates in your browser
    Where <YourBotToken> will be your bot's token.

json containing telegram chat id

If you did everything correctly, a JSON object will be displayed on the page in the browser. For more convenient display, we recommend checking the box next to Pretty-print in the browser.

Copy the "id" parameter of the "chat" object.

3. Setting up notifications in the program

Next, you need to copy the received data to the program.

call program settings

Click Program settings, select Messengers. Paste the received data into the appropriate fields.

setting up alerts in Telegram in the monitoring program

Then in the list of checks, find the check whose results you want to receive in Telegram. Right-click on it and select Edit check from the context menu.

edit check

Click Next several times until you reach step 3. Then check the box next to Perform on passed check or Perform on failed check, or both at once.

Specify the Telegram messenger as the notification method, as shown in the image below.

setting up a monitoring check to send alerts to Telegram

If you plan to receive all notifications in one chat bot, then the Chat ID field can be left blank, since you specified this identifier in the general program settings. At the level of individual monitoring checks, this field is necessary for sending notifications to different chat bots. If you have several bots, specify the ID of the bot that was created for alerts of this particular check.

At this stage, you can immediately test the operation of the notification. When you click the Test button, a test message should be sent to the chat bot.

testing sending and receiving alerts in telegram

Done.

Now notifications about checks will come as messages to the Telegram chatbot you created.

 

 

Related Links: