I am using a custom check script that returns 4 diffrent states. (0 = OK, 1 = Warn, 2 = Crit, 3 = Unknown)
Icinga2 stores this data in an influxdb DB and I want to use Grafana to display the data.
My first thought was to customize the Y axis Units, so instead of the numbers 0 - 3 it would show the associated states.
But this seems to be not possible.
My second thought is to create multiple queries that each return only one state and name these queries to the associated states.
But I cant find out how to create a query that only searches for one specific value.
SELECT min("state") FROM "check_myscript" WHERE "hostname" = 'myHost' AND "service" = 'myService' AND $timeFilter GROUP BY time($__interval)
In this query I am searching for the minimal value in the field state. But I want to search for the value 3.
If anybody knows how to do this, or has another solution, please share it with me.