Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated documentation! #13

Merged
merged 3 commits into from
Jan 7, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 34 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,38 @@
# Zabbix-in-Telegram
Zabbix Notifications with graphs in Telegram

Join us on **Telegram group**: https://telegram.me/joinchat/AGnFigJ_NW75IGNnpOyjig
Join us in our **Telegram group** via this link: https://telegram.me/joinchat/AGnFigJ_NW75IGNnpOyjig

### Features
- [x] graphs based on latest data are sent directly to your messenger
- [x] you can send them both in private and group chats
- [x] saves chatid as a temporary file
- [x] Graphs based on latest data are sent directly to your messenger
- [x] You can send them both in private and group chats
- [x] Saves chatid as a temporary file

### Configuration
### Configuration / Installation

**First of all**: you need to install `requests` module for python: `pip install requests`
**First of all**: You need to install the `requests` module for python, this is required for operation! </br>
To do so, enter `pip install requests` in your commandline!

* place `zbxtg.py` to `AlertScriptsPath` directory
* create `zbxtg_settings.py` with your settings and save them
* create bot in Telegram and get API key
* create readonly user in Zabbix
* set proxy host:port in `zbxtg_settings.py` if you need
* add new media for Telegram in Zabbix web interface
* send something to your bot, e.g. "/start"
* if you are in group chat, just mention it, e.g. `@ZbxTgDevBot ping`
* create new action like this:
* Place `zbxtg.py` in your `AlertScriptsPath` directory, the path is set inside your zabbix_server.conf
* Create `zbxtg_settings.py` with your settings and save them in the same directory as the script, see example for layout
* Create a bot in Telegram and get API key
* Create readonly user in Zabbix
* Set proxy host:port in `zbxtg_settings.py` if you need an internet proxy
* Add new media for Telegram in Zabbix web interface with these settings:

![](http://i.imgur.com/sjGjwo5.png)

* Send a message to your bot via Telegram, e.g. "/start"
* If you are in group chat, just mention your bot, e.g. `@ZbxTgDevBot ping`
* Create a new action like this:

<img src="http://i.imgur.com/ZNKtBUX.png" width="400px" height="340px">

* Add the appropriate Media Type to your user
* The username is CASE-SENSITIVE

![](http://i.imgur.com/doHpeOP.png)

<img src="http://i.imgur.com/ZNKtBUX.png" width="300px">
#### Annotations
```
zbxtg;graphs -- enables attached graphs
Expand All @@ -35,6 +45,14 @@ zbxtg;debug -- enable debug mode, some logs and images will be saved in the tmp

You can use markdown in your action: https://core.telegram.org/bots/api#using-markdown

#### Debug

* You can use the following command to send a message from your command line: </br>
`./zbxtg.py "<username>" "<message>" "<message>"`
* For `<username>` substitute your Telegram username, NOT that of your bot (case-sensitive)
* For `<message>` just substitute something like "test"
* You can omit the `"`, these are optional

---

![](http://i.imgur.com/1T4aHuf.png)
Expand Down