Home Linux ServerTools How to set up Zabbix alerts via Telegram

How to set up Zabbix alerts via Telegram

by Thạch Phạm
Published: Last Updated on
A+A-
Reset

How to set up Zabbix alerts via Telegram with 4 simple steps.

Introduction

Currently, the use of the Telegram application as a communication channel & notification channel is increasingly popular and gradually becoming an indispensable application for most users worldwide. With the Telegram application, the developer has done a great job in developing an application where the privacy and security of the user come first and is not under the control of any organization.

And in addition to being a secure chat application, it has high stability. Telegram is also a perfect, fast and supported notification channel on many platforms by creating and connecting exclusively via API/Token… And in this article, AZDIGI will guide you to use Telegram in combination with Zabbix Agent as a channel to receive alerts quickly and accurately.

And on the new versions of Zabbix, they have understood and satisfied users when they have built-in Telegram Templates to make it very simple to set up alerts via Telegram, you can check out the instructions below to set it up.

Implementation Guide

Step 1: Create a Bot on Telegram

To connect with @BotFather to get a Token, go to Telegram => search @BotFather and select @BotFather with a tick as shown below. Or you can go directly to https://telegram.me/BotFather link to connect with @BotFather.

How to set up Zabbix alerts via Telegram
Press START to start the conversation.

Type /newbot to create a new bot.

How to set up Zabbix alerts via Telegram

Next, you enter a name for the bot to create (Note: the bot name must end with the word Bot. For example, kbazBot )

How to set up Zabbix alerts via Telegram

After successfully entering the Bot name, you will be provided with Token to access HTTP API as shown above (red frame). You proceed to save this Token segment.

Then you press START bot just created for it to work.

How to set up Zabbix alerts via Telegram

Step 2: Instructions to get ChatID on Telegram

Next, you need to get the Bot ID and ID Groups.

  • Get Bot ID

To get IDBot, go to Telegram => search for IDBot and press START to start chatting.

How to set up Zabbix alerts via Telegram

Next, type /getid to get the Bot’s ID, the ID will be in the form of numbers as shown below:

How to set up Zabbix alerts via Telegram
  • Get Group ID

To get the Group ID, you first need to have a certain Group to receive warnings or if you don’t have one, you can create a new Group. For example, I already have Groups named “AZ – Cảnh báo” and I will do a demo with this Group.

Now you proceed to add the Bot @myidbot to the member of the Group. After adding, type /getgroupid @enter_your_bot_name.

If entered correctly, you will receive Group ID as shown below:

How to set up Zabbix alerts via Telegram

Step 3: Set up Telegram on Zabbix

  • Set up Media types

First, you need to log in to the Zabbix admin page, continue to access Administration >> Media types >> Telegram

How to set up Zabbix alerts via Telegram

In this setup section, you just need to pay attention and fill in the To & Token information according to the content of the image below:

How to set up Zabbix alerts via Telegram
After filling in the information, click Update.

To check if the configuration is successful, you can do a quick test as shown below:

How to set up Zabbix alerts via Telegram

If you receive a warning sent to Group on Telegram as shown below, it is successful.

How to set up Zabbix alerts via Telegram

  • Create user alert via Telegram

At the Zabbix interface, go to Administration >> Users >> Admin

How to set up Zabbix alerts via Telegram

Next, press the Media tab => click Add.

How to set up Zabbix alerts via Telegram

In the Media section, you will specifically fill in the following information:

How to set up Zabbix alerts via Telegram
Click Add to complete.

After the configuration is complete, click Update.

CleanShot 2022 04 23 at 10.57.43
  • Create Action to send notifications via Telegram

Now you need to create an Action to send notifications to Telegram. Because if you don’t create it, the system will only notify you in the Zabbix interface.

Go to Configuration >> Action >> Trigger actions >> Create action.

How to set up Zabbix alerts via Telegram

At the Action tab, you name the Action.

CleanShot 2022 04 21 at 23.28.15

Next, you switch to the Operations tab and fill in the following information:

Default operation step duration: I will set 3m, corresponding to 3 minutes.

Operations: You select Add, and in the Send to user groups section, seclect Add and add Zabbix administrators.

How to set up Zabbix alerts via Telegram

Recovery operations: You select Add, in the Send to user groups section, select Add and add Zabbix administrators.

How to set up Zabbix alerts via Telegram
Click Add (3) and Add (4) to complete the setup.

After completing the configuration, you will see Action Telegram and if the status: Enabled is done.

CleanShot 2022 04 23 at 09.28.00

After setting up everything, I will test Zabbix to see if it will send a warning about Telegram by turning off Ping on the Client server that I’m monitoring. And below is the warning Zabbix sent to my Telegram when it couldn’t Ping to the other server.

CleanShot 2022 04 23 at 11.26.19

So AZDIGI has completed the steps on setting up Zabbix alerts via Telegram. If you have any questions during the process, you can leave a comment below. Hopefully, this article will help you and next time AZDIGI will continue to write more articles about Zabbix so that you can better understand how to use and operate Zabbix.

You can refer to other instructions at the link below:

If you need assistance, you can contact support in the ways below:

Đánh giá

Tham gia nhóm hỗ trợ Server - Hosting

Tham gia nhóm Hỗ trợ Server - Hosting & WordPress để cùng nhau hỏi đáp và hỗ trợ các vấn đề về WordPress, tối ưu máy chủ/server.

Tham gia ngay

Bài viết cùng chuyên mục

AZDIGI – Không chỉ là đơn vị hàng đầu trong lĩnh vực Web Hosting và Máy chủ, chúng tôi mong muốn mang lại những kiến thức bổ ích nhất và luôn cập nhật thường xuyên cho cộng đồng người đam mê thiết kế website, công nghệ,…

Vui lòng không sao chép nội dung nếu chưa xin phép. Designed and Developed by PenciDesign