zensqlmonitor / influxdb-zabbix

Gather data from Zabbix back-end and load to InfluxDB in near real-time for enhanced performance and easier usage with Grafana.
MIT License
71 stars 26 forks source link

table groups renamed in zabbix 4 #18

Closed piotr-sikora-v closed 4 years ago

piotr-sikora-v commented 5 years ago

I have trouble with this error:

2019/05/15 07:47:18 [...db-zabbix/log/log.go:299 Error()] [E] Error while executing script: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups grp on grp.groupid = hg.groupid
WHERE grp.internal=0
   AND tre.clock > 1' at line 35
2019/05/15 07:47:18 [...db-zabbix/log/log.go:299 Error()] [E] Error while executing script: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups grp on grp.groupid = hg.groupid
WHERE grp.internal=0
   AND his.clock > 1' at line 33
2019/05/15 07:47:18 [...db-zabbix/log/log.go:299 Error()] [E] Error while executing script: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups grp on grp.groupid = hg.groupid
WHERE grp.internal=0
   AND his.clock > 1' at line 33
2019/05/15 07:47:18 [...db-zabbix/log/log.go:299 Error()] [E] Error while executing script: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups grp on grp.groupid = hg.groupid
WHERE grp.internal=0
   AND tre.clock > 1' at line 35

This problem is only with zabbix > 4.0 due to mysql8 have "groups" word reserved. Everything works after change 4 lines in input/mysql.go

piotr-sikora-v commented 5 years ago

solution also is in pull request https://github.com/zensqlmonitor/influxdb-zabbix/pull/16

zensqlmonitor commented 4 years ago

ok fixed for postgresql and mysql