using Icinga2, InfluxDB, Grafana setup. We are monitoring some Dell switches using SNMP and the output is stored in InfluxDB. Because one switch can have more fans, I want be able to display all fans in one graph. Right now I am playing with status only.
The problem. The data structure in DB looks like this:
time hostname metric service value
---- -------- ------ ------- -----
1542725873000000000 dell-powerconnect-2824 iso.3.6.1.4.1.89.83.1.1.1.3.67109249 fan 1 1
Value is stored in value and the meaning for the value is stored in service column. I am looking for way to display the value with service as a legend to the graph (marked with red on the screenshot).
I am not sure I understand you well, because I think a lack the terminology here (whoops). By tag you mean a column, field? Or is “tag” something that’s has to be setted up in Grafana?
Tag would be the same as a “field” for influxdb. You’re query would need to be modified to have a group by that includes the tags(fields) you want to reference.
the group by would look like this:
GROUP BY time($__interval), "service" "hostname" fill(previous)
SELECT mean("value") FROM "snmp" WHERE ("hostname" =~ /^$hostname$/ AND "service" =~ /^fan [0-9]+$/) AND $timeFilter GROUP BY time($__interval), "service", "hostname" fill(previous)
It’s sort of logic The query before had no clue about services. Well space to grow, thanks