{"id":13611364,"url":"https://github.com/ableev/Zabbix-in-Telegram","last_synced_at":"2025-04-13T04:34:04.958Z","repository":{"id":35010093,"uuid":"39106006","full_name":"ableev/Zabbix-in-Telegram","owner":"ableev","description":"Zabbix Notifications with graphs in Telegram","archived":false,"fork":false,"pushed_at":"2023-05-22T21:33:48.000Z","size":186,"stargazers_count":772,"open_issues_count":41,"forks_count":235,"subscribers_count":86,"default_branch":"master","last_synced_at":"2024-08-01T19:57:19.862Z","etag":null,"topics":["bot","notifications","telegram","telegram-bot","zabbix","zabbix-alert","zabbix-alertscript","zabbix-notifications"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"chwzou/PagerSlidingTabStrip","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ableev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-07-14T23:41:15.000Z","updated_at":"2024-07-27T22:57:47.000Z","dependencies_parsed_at":"2024-01-14T06:56:35.798Z","dependency_job_id":null,"html_url":"https://github.com/ableev/Zabbix-in-Telegram","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ableev%2FZabbix-in-Telegram","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ableev%2FZabbix-in-Telegram/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ableev%2FZabbix-in-Telegram/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ableev%2FZabbix-in-Telegram/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ableev","download_url":"https://codeload.github.com/ableev/Zabbix-in-Telegram/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223568184,"owners_count":17166613,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","notifications","telegram","telegram-bot","zabbix","zabbix-alert","zabbix-alertscript","zabbix-notifications"],"created_at":"2024-08-01T19:01:54.573Z","updated_at":"2024-11-07T18:30:21.148Z","avatar_url":"https://github.com/ableev.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Zabbix-in-Telegram\nZabbix Notifications with graphs in Telegram\n\nJoin us in our **Telegram group** via this link: https://t.me/ZbxTg\n\nSubscribe to our channel: https://t.me/Zabbix_in_Telegram\n\nRate on [share.zabbix.com](https://share.zabbix.com): https://share.zabbix.com/cat-notifications/zabbix-in-telegram\n\n### Features\n- [x] Graphs based on latest data are sent directly to your messenger\n- [x] You can send messages both in private and group/supergroup chats\n- [x] Channels support (only public, but you can do it for private as well with dirty hack)\n- [x] Saves chatid as a temporary file\n- [x] Simple markdown and HTML are supported\n- [x] Emoji (you can use emoji instead of severity, see [the wiki article](https://github.com/ableev/Zabbix-in-Telegram/wiki/Trigger-severity-as-Emoji)) (zabbix doesn't support utf8mb4 encoding yet)\n- [x] Location map\n\n### TODOs\n- Simple zabbix's management via bot's commands – in dev state\n- Ability to send complex graph or part of screen\n\n\n### Configuration / Installation\n\n**READ WIKI IF YOU HAVE PROBLEM WITH SOMETHING**: https://github.com/ableev/Zabbix-in-Telegram/wiki\n\n**First of all**: You need to install the appropriate modules for python, this is required for operation! \u003c/br\u003e\n                  To do so, enter `pip install -r requirements.txt` in your commandline!\n\n * Put `zbxtg.py` in your `AlertScriptsPath` directory, the path is set inside your `zabbix_server.conf`\n * Put `zbxtg_group.py` in the same location if you want to send messages to the group chat (if you are using Zabbix 2.x version)\n * Create `zbxtg_settings.py` (copy it from `zbxtg_settings.example.py`) with your settings and save them in the same directory as the script, see example for layout\n  * Create a bot in Telegram and get API key: https://core.telegram.org/bots#creating-a-new-bot\n  * Create readonly user in Zabbix web interface (for getting graphs from zabbix)\n  * Set proxy host:port in `zbxtg_settings.py` if you need an internet proxy (socks5 supported as well, the wiki will help you)\n * Add new media for Telegram in Zabbix web interface with these settings:\n \n\u003cimg src=\"https://i.imgur.com/Ytrbe4S.png\" width=\"400px\"\u003e\n\n * Add another one if you want to send messages to the group\n \n\u003cimg src=\"http://i.imgur.com/OTq4aQd.png\" width=\"400px\"\u003e\n\n * **Note that Zabbix 3.0 has different settings for that step, see it there**: https://github.com/ableev/Zabbix-in-Telegram/wiki/Working-with-Zabbix-3.0\n * Send a message to your bot via Telegram, e.g. \"/start\"\n  * If you are in a group chat, start a conversation with your bot: `/start@ZbxTgDevBot`\n * Create a new action like this:\n```\nLast value: {ITEM.LASTVALUE1} ({TIME})\nzbxtg;graphs\nzbxtg;graphs_period=10800\nzbxtg;itemid:{ITEM.ID1}\nzbxtg;title:{HOST.HOST} - {TRIGGER.NAME}\n```\n\n\u003cimg src=\"https://i.imgur.com/ZNKtBUX.png\" width=\"400px\"\u003e\n\n * Add the appropriate Media Type to your user\n  * The username is **CASE-SENSITIVE**\n  * If you don't have a username, you can use your chatid directly (and you need to google how to get it)\n  * Group chats don't have URLs, so you need to put group's name in media type\n  * Messages for channels should be sent as for private chats (simply add bot to your channel first and use channel's username as if it was a real user)\n\n  * Private:\n\n  \u003cimg src=\"https://i.imgur.com/GVDlTU5.png\" width=\"400px\"\u003e\n\n  * Group:\n\n  \u003cimg src=\"https://i.imgur.com/TgcCqDf.png\" width=\"400px\"\u003e\n\n#### Annotations\n```\nzbxtg;graphs -- enables attached graphs\nzbxtg;graphs_period=10800 -- set graphs period (default - 3600 seconds)\nzbxtg;graphs_width=700 -- set graphs width (default - 900px)\nzbxtg;graphs_height=300 -- set graphs height (default - 300px)\nzbxtg;itemid:{ITEM.ID1} -- define itemid (from trigger) for attach\nzbxtg;itemid:{ITEM.ID1},{ITEM.ID2},{ITEM.ID3} -- same, but if you want to send two or more graphs, use complex trigger\nzbxtg;title:{HOST.HOST} - {TRIGGER.NAME} -- graph's title\nzbxtg;debug -- enables debug mode, some logs and images will be saved in the tmp dir (temporary doesn't affect python version)\nzbxtg;channel -- enables sending to channels\nzbxtg;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)\nzbxtg;to_group:Group Name One,Group Name Two -- the same but for groups\n```\n\nYou 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. \n\n#### Debug\n\n* You can use the following command to send a message from your command line: \u003c/br\u003e\n`./zbxtg.py \"@username\" \"first part of a message\" \"second part of a message\" --debug`\n * For `@username` substitute your Telegram username, **NOT that of your bot** (case-sensitive) OR chatid\n * For `first part of a message` and `second part of a message` just substitute something like \"test\" \"test\" (for Telegram it's doesn't matter between subject and body)\n * You can skip the `\"` if it's one word for every parameter, these are optional\n\n---\n\n![](http://i.imgur.com/1T4aHuf.png)\n![](http://i.imgur.com/5ZPyvoe.png)\n\n### Known issues\n\n#### MEDIA_CAPTION_TOO_LONG\nIf you see this error, it means that you rich the limit of caption with 200 symbols in it (Telegram API's limitaion).\nSuch captions will be automatically cut to 200 symbols.\n\n#### Zabbix 3.0 and higher (3.2, 3.4, 4.0, 4.2, 4.4)\nhttps://github.com/ableev/Zabbix-in-Telegram/wiki/Working-with-Zabbix-3.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fableev%2FZabbix-in-Telegram","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fableev%2FZabbix-in-Telegram","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fableev%2FZabbix-in-Telegram/lists"}