Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't Change Metric Alias in Grafana Using a Zabbix Plugin

Tags:

grafana

zabbix

I want to show multiple CPU Usage from different hosts in one graph but they all end up with the same name and I can't tell which line represents which host: here's the snapshot.

I'm using Grafana 5.2.4 with a Zabbix plugin 3.9.1. My Zabbix version is 3.0.12. I've tried overriding legends in Grafana but there's no such option. Also, Zabbix plugin doesn't allow connecting directly to DB, so I can't use the ALIAS BY option either. I've tried using macros in Zabbix to include host name in item name, but {HOST.NAME} just ends up as is in the item name (and not replaced by the actual values).

Any solutions will be hugely appreciated.

like image 950
Farinaz Avatar asked Sep 25 '18 07:09

Farinaz


People also ask

Is Grafana better than Zabbix?

Grafana and Zabbix are both open source tools. Grafana with 29.3K GitHub stars and 5.55K forks on GitHub appears to be more popular than Zabbix with 493 GitHub stars and 182 GitHub forks.

Does Zabbix use Grafana?

Zabbix data source for Grafana allows you to visualize monitoring data from Zabbix and create dashboards for analyzing metrics and real-time monitoring. Using Grafana Zabbix plugin features, you can create dashboards to monitor data visualization in a quick and powerful way.

How do I install the Alexanderzobnin Zabbix app?

To install it, go to releases page, pick release you want to get and click on Assests . Built plugin packaged into zip archive having name alexanderzobnin-zabbix-app-x.x.x.zip . Download it, unpack into your Grafana plugins directory and restart grafana server.


1 Answers

You should use the templating feature of the Zabbix Grafana plugin,see the attached screens and the following description for a working example.

I have a Routers Zabbix Hostgroup, so I define a Router Grafana variable to match the hosts (Routers.*), see the first screenshot. Enable both multi-value and Select All enter image description here

Then in the metrics configuration use a single metric configured this way:

  • Group: Routers
  • Host: $Router (mind the $, the variable will be expanded in real time accordingly to the selection)
  • Item: the common item name (i.e.: ICMP Response Time)

And you will get something similar to the second screenshot, with a host picker on top and multiple selections.

enter image description here

like image 112
Simone Zabberoni Avatar answered Oct 01 '22 15:10

Simone Zabberoni