The PalmTree Network

Your money. Your time. Your future.

Zabbix Telegram Notifications

This section is part of Zabbix & Elrond Guide

To receive notifications on telegram we’ll need to create a new Telegram bot and start a chat with it. Don’t worry it’s a very intuitive process. The Bot is private and no one will use it except you.

CREATE YOUR TELEGRAM BOT

Open your telegram app and search for the user @BotFather and write this message:

/newbot

This is a command that tells the Bot Father to create you a new bot, choose your bot nick carefully as you will need it later. Take note of it. And you will receive too a new HTTP API look at this example:

new-bot.PNG

The boot HTTP API String it is something like the “from” field on an email.

GET YOUR OWN TELEGRAM ID

In order to be able to configure your user on Zabbix and configure sending messages to you, you will need your own id on telegram. Is something like “to” field on email.

You will need to search on telegram users for the bot @myidbot and send to it this two messages:

/start
/getid

And you will see something looking like this example:

tg-id.PNG

Now the last part, search for your new bot user created, maybe you called it “ZabbixBot760”, and send this message to him:

/start

CREATING A MEDIA TYPE

You must download the official Telegram Webhook, For this you must download the current api project in .zip

Download Zabbix API .ZIP

Unzip it and look for folder templates/media/telegram

There you will see a media_telegram.xml file

Open Zabbix frontend and go to Administration —> Media types and click on Import and select its new xml that we just find. When it’s imported we need to go again to Administration —> Media types to click on the new Telegram Media type and edit it.

tg-bottoken.PNG

On the ParseMode field you must write Markdown

You must edit only the field telegramToken and write the HTTP API of your bot. You have it noted from before.

Click on Update and remember to test your new Media type, from the Media Types list to the left you have “Test” link. Try it, remember to use on “To” field your telegram id (the one of your own user). This way the bot will write to you directly.

telegram-test.PNG

SETUP YOUR USER

Remember to go to Administration —> Users and edit your user (Admin) in Media types tab Add Telegram. The field “To” must be your id in telegram, the same that you used in the test.

Maybe you need to try a few times before you get it working.