Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grafana does not get units from Zabbix in 4.2 #1321

Closed
meyerder opened this issue Sep 30, 2021 · 4 comments
Closed

Grafana does not get units from Zabbix in 4.2 #1321

meyerder opened this issue Sep 30, 2021 · 4 comments
Labels
Milestone

Comments

@meyerder
Copy link

Issue: Incorrect Results Returned with 4.2 Branch plugin

Grafana v8.1.5 (c725a4259a)
Zabbix API version: 5.0.13

Screenshots below show.. Nothing really complex... The strange thing is it only appears to be different on the Memory and Drive Space that I have found so far... Initially noticed it with the Stats Display so I tried Table just to make sure I was not missing anything... Seems to be incorrect data no matter how I look at it..

Note: I tried the 4.2 and 4.2.4 Branch (same results)

Plugin_Install
4_1_plugin
4_2
Zabbix_Screen

@meyerder
Copy link
Author

This is interesting... I noticed after I posted it one version said "GiB" and one Said "GB" Both 4.2 and 4.1 Branches when No Units are applied say 16976740352.0

Ok Im very confused...

Version 4.1.5 The unit is Bytes(SI) and it shows correct (which is what I had it)
4_1_5_units

Version 4.2.x If I change it to ICE it then is proper with the right labels... Bear in mind the version of Grafana is Not Changing..

4_2_Units

@alexanderzobnin
Copy link
Collaborator

Hi! That's probably a units from zabbix, that Grafana cannot override for some reason.

@alexanderzobnin alexanderzobnin added this to the 4.2.5 milestone Oct 21, 2021
@alexanderzobnin
Copy link
Collaborator

Ok. Since version 4.2 plugin makes metric queries completely on the backend. There's no feature that uses units from Zabbix on the backend, so I think what happend is:

  1. Panel is configured to use GB (bytes SI).
  2. Zabbix returns GiB (bytes IEC in Grafana), but in Zabbix it shown as a GB (which is not 100% accurate, actually).
  3. In 4.1 plugin overrides units configured in the panel and returns GiB.
  4. In 4.2 it returns no units configured and Grafana uses units from panel (GB).

So you just need to set proper units which is bytes IEC.
I should add this feature to the backend, but there's some issues with it. It should be possible to override this unit in the panel config.

@alexanderzobnin alexanderzobnin changed the title Incorrect Results Returned with 4.2 Branch plugin Grafana does not get units from Zabbix in 4.2 Feb 17, 2022
@CirnoT
Copy link

CirnoT commented Feb 17, 2022

It should be possible to override this unit in the panel config.

It seems that you can not do that with Grafana v8. For example I've tried to display graph of W calculated from % usage from UPS data but version 4.2.5 insists that my data modified with scale is in % and no amount of play would convince it otherwise. To make matters worse, any value above 100 is treated as 100% making usage of scale useless on % units.

For reference, I modify Output Load OID from APC (which is in %) with scale(0.01) scale(VA_factor) scale(PF_factor) which results in a close approximation of W. Grafana is being told that the field A is of unit Watt (W).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants