Grafana Zabbix Plugin
Video Lecture
Description
Grafana is good for monitoring time series data, and so is Zabbix,
Grafana is another option for viewing Zabbix Data, and data from many other data sources.
In this lecture, I will install Grafana OSS on the same server as my Zabbix Server.
For Grafana install instructions visit https://grafana.com/grafana/download
I have already prepared the commands for my system.
sudo apt-get install -y adduser libfontconfig1
wget https://dl.grafana.com/oss/release/grafana_8.5.2_amd64.deb
sudo dpkg -i grafana_8.5.2_amd64.deb
Then start the service
sudo service grafana-server start
Your Grafana server will be hosted at
http://[your zabbix server ip or domain name]:3000
Default login is
username : admin
password : admin
You then need to install the Zabbix plugin, and add the data source.
When configuring the Zabbix plugin, your API URL will be similar to this below.
https://[your zabbix server ip or domain name]/zabbix/api_jsonrpc.php
You should also create a user in Zabbix that the data source in Grafana will use to connect to the Zabbix API.
Create Zabbix Specific MySQL Data Source
We can create a MySQL Data Source that will connect directly to the Zabbix Servers MySQL Database. This is useful if you want to improve performance.
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 the MySQL and check the status.
sudo service mysql restart
sudo service mysql status
Go back into Grafana, and configure the direct DB connection for the Zabbix data source.
Uninstall Grafana
If you are serious about using Grafana long term, then I suggest installing it on a separate server, rather than on the Zabbix server.
To uninstall Grafana,
sudo dpkg -r grafana
Grafana Course
If you want to try a more detailed course on Grafana, then you can visit my Grafana tutorials.