Telegram

Pandora FMS integration with a Telegram bot

Telegram

Step-by-step to integrate with a Telegram bot

NOTE: This guide is under construction.

TelegramLogo.png

Introduction

Telegram bots CLI connector for use in Pandora FMS alerts.

Compatibility matrix

Requirements

The requirements are as follows:

Configuration

Creation of the BOT in Telegram

From a Telegram account you must write /start to the user BotFather (https://telegram.me/botfather) to create a bot.

It will return us a series of parameters and instructions that we can make for the creation and manipulation of bots.

image-1608158507569.png

We will use the option /newbot with which we will create a new bot.
It will ask us the name we want to give our bot, in my case I have selected  Pandora_FMS_Test_bot you can put the one you prefer.

Now it will ask us for a user ID for the bot, this has to end in _bot, in this case I will use the same.  Pandora_FMS_Test_bot

Now it will return us The information about our bot and some instructions for its administration, we will copy and save the API token with which we will authenticate ourselves as that bot

PandoraFMS-NTelegram01.png

Create a group and add the bot

To create a group from Telegram simply click on create group and select the users that will be in that group is important that one of those users is our bot to be able to send messages to that specific group also we can simply add the bot to an existing group.

PandoraNTelegram02.png

Get the group id to send messages from the CLI

Now we need to obtain the id of the group in which we have added our bot, there are different ways to do it, but the simplest is to add another bot that extracts that information very easily GetIDs Bot (https://t.me/getidsbot).

We add it to the group that we want to know the id of and it will give us a series of instructions for its use. But just adding it will give us more. The information we need is the group id.

PandoraFMS-NTelegram03.png

Once we have the group id, we copy and save it, we can eliminate this bot from the group if we want, it has already fulfilled the objective of giving us the id.