Zabbix RealTime Exporter¶
Collect real-time data from the Zabbix service and send it to the GuanCe cloud center. Currently, Zabbix supports writing real-time data to files from version 5.0 to 7.0. ExportType allows to specify which entity types (events, history, trends) will be exported.
Zabbix Config¶
Zabbix config file: /etc/zabbix/zabbix_server.conf :
### Option: ExportDir
# Directory for real time export of events, history and trends in newline delimited JSON format.
# If set, enables real time export.
#
# Mandatory: no
ExportDir=/data/zbx/datakit
### Option: ExportFileSize
# Maximum size per export file in bytes.
# Only used for rotation if ExportDir is set.
#
# Mandatory: no
# Range: 1M-1G
ExportFileSize=32M
### Option: ExportType
# List of comma delimited types of real time export - allows to control export entities by their
# type (events, history, trends) individually.
# Valid only if ExportDir is set.
#
# Mandatory: no
# Default:
# ExportType=events,history,trends
Modify the configuration items:
Permission to modify files:
mkdir -p /data/zbx/datakit
chown zabbix:zabbix -R /data/zbx/datakit
chmod u+rw -R /data/zbx/datakit/
Attention: When the size of the configuration file is small, it is measured based on the host configuration. Files that are too large can easily cause insufficient disk space. And the .old
files should be deleted regularly.
Restart server:
Config¶
Go to the conf.d/zabbix_exporter
directory under the DataKit installation directory, copy zabbix_exporter.conf.sample
and name it zabbix_exporter.conf
. Examples are as follows:
[[inputs.zabbix_exporter]]
# [inputs.zabbix_exporter.tags]
# key1 = "value1"
# key2 = "value2"
# ...
# Zabbix server version 5.x.
[inputs.zabbix_exporter.export_v5]
# zabbix realTime exportDir path
export_dir = "/data/zbx/datakit/"
Restart DataKit server.
Docs¶
- Zabbix Documentations: 5.0 real_time_export
- 6.0 real_time_export
- 7.0 real_time_export