Configure Zabbix to send alerts to your phone using Telegram

NC

This article explains How to Send alert Telegram messages to your phone using Zabbix.  You monitor network devices using Zabbix and want alerts sent to your phone. Because you simply can't sit next to your computer all the time and wait for warnings. This article will show you how to configure Zabbix to send alerts to your phone using Telegram.

Create a chat bot

To configure messaging with Telegram you need to create a chat bot. From that chat bot you will get username, token. You create a new chat bot with the help of bot father. You start with the start command and then use the newbot command to start creating a new chat bot. You name your chat bot, to make it easy to remember I name it containing the character zabbix.

Please read this article for specific steps: Send alert Telegram messages to your phone using LibreNMS

Next you create a username that ends in bot. And this is the token that you will receive, and you will copy and paste it into the Telegram configuration on Zabbix. Next you configure the chat id so you create a chat group where alert messages are sent there. I created a new chat group with 2 members including me and the chat bot I just created. You can add more members if you want. All members of the chat group received the same warning messages as you.

So I have a new chat group called zabbix alerts. When you select the newly created chat group, you will notice that there is a last sequence of numbers in the address bar. That's your chat id, don't ignore the dash in front of that number. You can only see your chat id when you open Telegram with a web browser. You don't see chat id when using Telegram app. 

Telegram configuration on Zabbix

Go to "Administration" > "Media types", click "Telegram".

Configure Zabbix to send alerts to your phone using Telegram

You copy and paste the chat id into Zabbix's Telegram configuration.

Configure Zabbix to send alerts to your phone using Telegram

You send a test message to make sure the configuration is correct. So your token configuration and chat Id are correct.

Configure Zabbix to send alerts to your phone using Telegram

As you can see a message has been sent to your new chat group.

Configure Zabbix to send alerts to your phone using Telegram

Configure Users

Next, configure your account to send you alerts. Go to "Administration" > "Users", then switch to "Media" panel, Click "add". You choose to send the alert message as Telegram.

Configure Zabbix to send alerts to your phone using Telegram

You can create a new account and give it full permission to send alerts. But here I always use the highest administrator account, Admin, to configure sending messages. Here you can choose the type of alert sent with different levels. Because by default all such alerts are sent too much and sometimes are unnecessary.

Configure Zabbix to send alerts to your phone using Telegram

Action Configuration

The final configuration step is action configuration. For the preconfiguration steps to happen, you need to configure the action. 

Go to "Configuration" > "Actions" > "Trigger actions".

Configure Zabbix to send alerts to your phone using Telegram

Then, click "Report problems to Zabbix administrators", switch to "Operations" panel, click "add".

You select user groups and users to send alert messages to. The user group used here is the "Zabbix Administrator group". User is "admin". With this action configuration you will receive a message when the problem occurs. and when the problem is fixed you will also receive a message letting you know.

Configure Zabbix to send alerts to your phone using Telegram

Configure Zabbix to send alerts to your phone using Telegram

By default, this action is disabled, so don't forget to enable it.

Configure Zabbix to send alerts to your phone using Telegram

The configuration steps are complete now I will create a problem to test the results. Currently on my monitoring system there is a mikrotik router with ip address 10.11.32.143. I will shutdown it and wait to see if Zabbix sends you a warning message via Telegram. Please wait patiently for the results. You see SNMP has turned red, there is a warning given.

Configure Zabbix to send alerts to your phone using Telegram

Zabbix system said it lost connection with Mikrotik router and sent a Telegram message. We checked the Telegram group chat and received a warning message. Luckily it worked.

Configure Zabbix to send alerts to your phone using Telegram

Facebook: https://www.facebook.com/routerbest

Twitter: https://twitter.com/routerbestcom

Tags: Telegram Zabbix