将zabbix数据导入到ES数据库中
1、 实验环境
Centos7、Zabbix(4.0.7)、ES数据库(5.0.2)
2、 配置ES数据库中支持的zabbix监控项类型(对应如下图):

为每个类型添加相应的ES mapping,命令为:
1 | curl -H "Content-Type:application/json" -XPUT http://localhost:9200/uint -d '{"settings":{"index":{"number_of_replicas":1,"number_of_shards":5}},"mappings":{"values":{"properties":{"itemid":{"type":"long"},"clock":{"format":"epoch_second","type":"date"},"value":{"type":"long"}}}}}' |
3、 修改zabbix server配置文件(/etc/zabbix/Zabbix_server.conf)
(1) 历史数据保存路径(HistoryStorageURL)
1 | HistoryStorageURL=127.0.0.1:9200 //本路径为本地ES数据库的路径 |
(2) 历史数据保存格式(HistoryStorageTypes)
1 | HistoryStorageTypes=uint,dbl,str,log,text |
4、 修改zabbix前端配置文件(/etc/zabbix/web/zabbix.conf.php),添加:
1 | $HISTORY['url'] = 'http://127.0.0.1:9200'; |
5、 重启服务
1 | systemctl restart httpd |
6、验证

在kibana上查看:


此外,还可以通过zabbix 的api;filebeat+logstash来实现。