Home Arrow Icon Knowledge base Arrow Icon Global Arrow Icon What are the steps to register a Telegram bot for Zabbix notifications


What are the steps to register a Telegram bot for Zabbix notifications


To register a Telegram bot for Zabbix notifications, follow these steps:

Step 1: Create a Telegram Bot

1. Open the Telegram app and search for `@BotFather`.
2. Start a chat with `@BotFather` and send the command `/newbot`.
3. Follow the prompts to name your bot (the name must end with "Bot", e.g., `MyZabbixBot`).
4. After creating the bot, `@BotFather` will provide you with a Token. Save this token, as it will be needed for Zabbix configuration.

Step 2: Obtain Your Chat ID

1. To get your Telegram user ID, search for `@myidbot` in Telegram.
2. Start a chat with `@myidbot` and send the command `/getid`. The bot will reply with your user ID, which you will use in Zabbix.

Step 3: Configure Zabbix Media Type

1. Log in to your Zabbix web interface.
2. Navigate to Administration > Media types.
3. Create a new media type for Telegram:
- Name: Telegram
- Type: WEBHOOK or SCRIPT (depending on your setup)
- Parameters:
- Token: Paste the token you received from `@BotFather`.
- To: Enter your chat ID obtained from `@myidbot`.

Step 4: Test the Configuration

- Use the test feature in Zabbix to ensure that notifications can be sent to your Telegram account.

Step 5: Set Up User Notifications

1. Go to Administration > Users and select the user you want to receive notifications.
2. In the Media tab, click Add and select the Telegram media type you just created.
3. Fill in the Send to field with your chat ID and configure the notification settings as desired.

Step 6: Create Actions for Notifications

1. Navigate to Configuration > Actions in Zabbix.
2. Create a new action to send notifications to the Telegram media type based on specific triggers or events.

Following these steps will enable Zabbix to send notifications to your Telegram bot effectively[1][3][6].

Citations:
[1] https://azdigi.com/blog/en/linux-server-en/tools-en/how-to-set-up-zabbix-alerts-via-telegram/
[2] https://github.com/GabrielRF/Zabbix-Telegram-Notification
[3] https://thepalmtree.network/en/zabbix-telegram-notifications/
[4] https://gist.github.com/KostyaEsmukov/1d49b04eaed1b8de3c8d378943fc1647
[5] https://www.youtube.com/watch?v=AHVRrRkY-AM
[6] https://www.zabbix.com/integrations/telegram
[7] https://gist.github.com/CHERTS/04a0905d53c136ee8d5a81c4af93bc9d
[8] https://dev.to/kurtchan/writing-a-telegram-and-email-notifications-script-for-zabbix-5ddj