Zabbix API and direct DB connection

Hi!

CentOS 7 3.10.0-693.21.1.el7.x86_64
mysql Ver 15.1 Distrib 5.5.56-MariaDB
Zabbix 3.4.8
grafana 5.0.4-1

I am configuring my grafana+Zabbix stack now, so I have a question.
I want to use direct db access to Zabbix mysql because it’s a bit rapid than Zabbix API.

I create a new data source in grafana for mysql (zabbix, mysql and grafana are located together):
image

Then I create another one for Zabbix (I use alexanderzobnin-zabbix-datasource plugin) and checked “Direct DB Connection - Enable”. But I couldn’t save my data source because it requires Zabbix API details!
image

But why? I want to use direct db instead API, so I do not have to specify Zabbix api details!
So I put here my Zabbix username and password and after that I could save data source.

After that, default “Zabbix Server Dashboard” switched on.
But now I’m not sure if I use direct db or API connection…

Hi! As described in docs (About Grafana-Zabbix - Grafana-Zabbix Documentation):

This chart illustrates how the plugin uses both Zabbix API and the MySQL data source for querying different types of data from Zabbix. MySQL data source is used only for pulling history and trend data instead of history.get and trend.get API calls.

So you should use API anyway. But API queries are cached, so you may don’t worry about performance.

2 Likes

One more question: If I use direct db access, I should use proxy or direct access?
image