Create and Configure a Zabbix Data Source

Video Lecture

Create and Configure a Zabbix Data Source Create and Configure a Zabbix Data Source

Description

First Create a MySQL Data Source that will connect directly to the Zabbix Servers MySQL Database.

SSH onto the Zabbix Server,

Create a user in MySQL, with read only access, that the Grafana MySQL data source will use to connect with.

mysql
> CREATE USER 'grafana'@'GRAFANA SERVER IP ADDRESS' IDENTIFIED BY 'password';

> GRANT SELECT ON zabbix.* TO 'grafana'@'GRAFANA SERVER IP ADDRESS';

> FLUSH PRIVILEGES;

> select host, user from mysql.user;

> QUIT;

Also allow remote connections on MySQL

sudo nano /etc/mysql/my.cnf

Change or Add the bind address value to the end of the file.

[mysqld]
bind-address    = 0.0.0.0

Restart MySQL

Restart the MySQL and check the status.

sudo service mysql restart
sudo service mysql status

Continue on the Grafana Server

I then finish and save the MySQL data source for Zabbix.

Now it's time to install the Zabbix Data Source plugin that will connect to the Zabbix API, and also use the new MySQL data source we just created.

I SSH onto the Grafana Server and add a Zabbix Data Source plugin using the CLI

grafana-cli plugins install alexanderzobnin-zabbix-app

Since Grafana v7, unsigned plugins won't be visible unless you explicitly allow them in the Grafana.ini file.

Open /etc/grafana/grafana.ini, and uncomment the line

;allow_loading_unsigned_plugins

and change to

allow_loading_unsigned_plugins = alexanderzobnin-zabbix-datasource

And then restart the Grafana server

sudo service grafana-server restart

I then use the Grafana UI to enable the Zabbix Data Soure Plugin, and then configure it.

The required API URL will be,

https://[your zabbix server ip or domain name]/zabbix/api_jsonrpc.php

Also select the 'Direct DB Access' to be the new MySQL data source you just created.

Save and Continue

Zabbix Course

If you want to try a more detailed course on Zabbix, then you can visit my Zabbix tutorials.