- How to make a condition in Grafana that checks 2 elements inside the panel and makes a conclusion in the 3rd element? I wanted to implement a check for opening the door lock in the rack. (1 - closed, 2 - open, 0 - error). The lock is powered by two inputs (A and B). If one input is disconnected, then the state of the lock should continue to be displayed as working. The logic looks something like this:
If A = 1 or B = 1, then C = 1 Else if A = 2 or B = 2, C = 2 Else if A = 0 or B = 0, C = 0.
The data comes from Zabbix.
2)How can I set up alerting if the data is coming from Zabbix?
Hey @ ea1rushik9 welcome to the foruns!
In your case, you can try Grafana using the Expression Queries for that, the docs are here: Write expression queries | Grafana documentation
BUT, in your case I would advise to use the Zabbix’s Calculated items. Easier to manage where the transformations for the data is hosted and managing to use the data in more places would be easier.
Hope it helps.
Hi! I already tried to write a simple expression “($A == 1) || ($B == 1)” first, but for some reason it did not compare correctly and always displayed the value “base”. I don’t know why this might be. The keys of the values ​​in Zabbix are the same and the temporary server works correctly.
I think that the best in your case would really be using Zabbix’s Calculated items and/or Zabbix’s Triggers paired with the Zabbix Problems panel on Grafana.
1 Like