Telegraf
Zabbix Sender output forFor using with Zabbix trapper items.
Usage
Installation
Just clone this repo somewhere, for example, in /opt/
.
This script requires Python 3 (tested with 3.6) and py-zabbix. Currently, the script depends on specific patch which is in an open Pull Request in upstream so you have to use bundled version:
git submodule init
git submodule update
Telegraf Configuration
Add to Telegraf config:
[[outputs.exec]]
command = ['/path/to/telegraf-zabbix-sender/telegraf-zabbix-sender']
data_format = 'json'
timeout = '20s'
[outputs.exec.tagpass]
zabbix_key = ['*']
Hint: You can replace ['/path/to/telegraf-zabbix-sender/telegraf-zabbix-sender']
with ['systemd-cat', '/path/to/telegraf-zabbix-sender/telegraf-zabbix-sender']
if you want to always see script's stdout and stderr in journal logs.
Zabbix Configuration
Configure Zabbix trapper item according to the documentation.
Using
- Only measurements with
zabbix_key
tag are processed. Value of this tag is used as an item key. Other tags and measurement name are ignored. - Measurements should have only one value field (with any key). If there are multiple of them, random one will be used as a value. You should use Unpivot Processor to split multi field series into single valued metrics to avoid undefined results.