Notifications through a Telegram bot
Sign in to read this lesson
Nobody reads e-mail at 3 at night, but a message on the phone is seen at once. In this lesson we create our own bot with BotFather, find the personal and group chat ID, set up the Telegram media type in Zabbix with the token and create an action that sends only High and Disaster problems to a Telegram group.
What you will learn
- A bot is created in @BotFather with the
/newbotcommand; the token it gives is like the bot's password and is kept secret. - A bot cannot start a conversation itself: for a personal message the user must first write
/startto the bot; for a group the bot is added to the group. - Chat ID: a private chat is a positive number, a group is negative, and a supergroup starts with
-100; it is found with agetUpdatesrequest. - In Zabbix, Alerts > Media types > Telegram:
api_tokenandapi_parse_mode; in the user's Media, Send to = the chat ID. - A separate action for Telegram: only High and Disaster, the rest by e-mail. This way there are fewer messages and the important ones are not lost.
The lesson has 5 key points, an explanation and 5 questions. It opens with a package.