ableev / Zabbix-in-Telegram

Zabbix Notifications with graphs in Telegram
MIT License
771 stars 235 forks source link
bot notifications telegram telegram-bot zabbix zabbix-alert zabbix-alertscript zabbix-notifications

Zabbix-in-Telegram

Zabbix Notifications with graphs in Telegram

Join us in our Telegram group via this link: https://t.me/ZbxTg

Subscribe to our channel: https://t.me/Zabbix_in_Telegram

Rate on share.zabbix.com: https://share.zabbix.com/cat-notifications/zabbix-in-telegram

Features

TODOs

Configuration / Installation

READ WIKI IF YOU HAVE PROBLEM WITH SOMETHING: https://github.com/ableev/Zabbix-in-Telegram/wiki

First of all: You need to install the appropriate modules for python, this is required for operation!
To do so, enter pip install -r requirements.txt in your commandline!

Annotations

zbxtg;graphs -- enables attached graphs
zbxtg;graphs_period=10800 -- set graphs period (default - 3600 seconds)
zbxtg;graphs_width=700 -- set graphs width (default - 900px)
zbxtg;graphs_height=300 -- set graphs height (default - 300px)
zbxtg;itemid:{ITEM.ID1} -- define itemid (from trigger) for attach
zbxtg;itemid:{ITEM.ID1},{ITEM.ID2},{ITEM.ID3} -- same, but if you want to send two or more graphs, use complex trigger
zbxtg;title:{HOST.HOST} - {TRIGGER.NAME} -- graph's title
zbxtg;debug -- enables debug mode, some logs and images will be saved in the tmp dir (temporary doesn't affect python version)
zbxtg;channel -- enables sending to channels
zbxtg;to:username1,username2,username3 -- now you don't need to create dedicated profiles and add media for them, use this option in action to send messages to those user(s)
zbxtg;to_group:Group Name One,Group Name Two -- the same but for groups

You can use markdown or html formatting in your action: https://core.telegram.org/bots/api#markdown-style + https://core.telegram.org/bots/api#html-style.

Debug


Known issues

MEDIA_CAPTION_TOO_LONG

If you see this error, it means that you rich the limit of caption with 200 symbols in it (Telegram API's limitaion). Such captions will be automatically cut to 200 symbols.

Zabbix 3.0 and higher (3.2, 3.4, 4.0, 4.2, 4.4)

https://github.com/ableev/Zabbix-in-Telegram/wiki/Working-with-Zabbix-3.0