Do I need to read PART 1?
If you have not read the PART 1 and you need to integrate Zabbix & Grafana, I Highly recommend you to read PART 1 before reading PART 2. But if you want to just install Grafana for your Data Visualization without Zabbix you can continue reading.
Grafana Installation Guide
We will user the machine which we were using for our Zabbix server in PART 1. So it’s Ubuntu Server 18.04 (bionic) and now it’s running Zabbix on it. In this section we will install Grafana and Zabbix-App plugin to be ready to Visualize it on our Grafana.
How to Install Grafana 6.2.5 and Zabbix-APP plugin
Downloading DEB package: To do that, You must execute this command
$ wget https://dl.grafana.com/oss/release/grafana_6.2.5_amd64.deb
Installing prerequiesites: We need to install adduser and libfontconfig1 and then install the downloaded DEB package
$ sudo apt-get install -y adduser libfontconfig1 $ sudo dpkg -i grafana_6.2.5_amd64.deb
Start Service: We need to start grafana-server service and also we need to start it at boot time. So, Execute these commands
$ sudo service grafana-server start $ sudo update-rc.d grafana-server defaults
That’s it: Now you can open Grafana frontend web application by browsing http://YOUR-SERVER-IP-or-FQDN:3000
When you open http://YOUR-SERVER-IP-or-FQDN:3000 address you must login using the default credentials and after you login it will immediately show change password page.
Installing Zabbix-APP plugin as a datasource: Grafana supports multiple data sources like InfluxDB, ElasticSearch, Graphite ,… but we are interested in using Zabbix-APP as an datasource to Visulize the items that our Zabbix Servers gathered from different sources. You can find it here https://grafana.com/grafana/plugins/alexanderzobnin-zabbix-app. To install this plugin we can use Grafana CLI. Run the further command to do that.
$ sudo -u grafana grafana-cli plugins install alexanderzobnin-zabbix-app
After that, We need to restart our Grafana Server service to make Zabbix App plugin available.
$ sudo service grafana-server restart
Now get back to your browser and enable this plugin using the Enable now link. Here is the screenshot:
Then click on Enable button on the next page
Adding Zabbix Data Source: To add Zabbix as a Data source for Grafana, get back to Grafana home by clicking on the top left Icon and then click on Add data source like the screen shot
In this page select Zabbix from the list
Since we are on a test server I will use Admin username and password which we mentioned in PART 1 to connect to Zabbix Server but in production define a READ-ONLY user on your Zabbix define here
As shown in screenshot use need to fill these fields and click on Save & Test to save this data source.
Name: Name of your Datasource
URL: Your Zabbix URL: It must be in this format: http://YOUR-SERVER-IP-ADDRESS/zabbix/api_jsonrpc.php
Username: Zabbix User
Password: Zabbix User’s password
Test data gatherings and Visualize them
We have successfully integrated Zabbix with Grafana. Now it’s time to test and visualize some awesome charts. To do that, go to your Grafana home page by clicking on the top left log
Create Dashboard: To create your dashboard click on New Dashboard
Click on Add Query: To visualize information Add Query button
Visualization: Since our metrics units are bytes/sec we have to change it in Visualization Tab. Change the Unit to bytes/sec in Axes section
Visualization (Show Table, AVG, MIN, MAX and CURRENT): Scroll down a bit to Legend section and do the same things as shown in the screenshot image
Change the panel Title: Click on the Settings and change the title as you wish 😉 and press ESC KEY to get back to your dashboard
You can resize it to your need I like it to be a full width panel in my dashboard 😀
What else I can do?
Anything that you gather by your Zabbix can be shown by Grafana. As an exercise you can add Free Space and Available Memory of your Zabbix Server just like the further screenshot
If you have any question, You can ask it by commenting 😉
In next Blog post I will show you how to gather information from your vCenter Cluster using Zabbix and Use Grafana to Monitor & I will share a dashboard with you that you can simply Import it to your Grafana to Visualize things that you might missed them before. I would be happy to get your feedback, So If you have any thing to say, you comment it here and I will reply it ASAP. 😉