Icingaweb2-module-grafana Influxdb2

Hi, have influxdb2writer working with external influxdb2 server, grafana10.x can use data source. Is icingaweb2-module-grafana able to work with influxdb2 at all?

Correct me if I’m wrong, but afaik the icingaweb2 module doesn’t care what datasource you use in grafana.

So yes, it works. Can confirm for IcingaDB Web, Module v2.0.3 and Grafana v10 with Influx2

Great, I get all kinds of errors when trying. The included dashboards (icinga2-default) is still for influxdb1, I tried to install the Grafana image render but plugin fail. If using grafana 10, what is preferd auth method? Use api token in my old stack. Thank you for any info on how you got it working :+1:

We use the API token for authentication.

Image renderer troubleshooting: https://grafana.com/docs/grafana/latest/setup-grafana/image-rendering/troubleshooting/

Here is an Influx v2 dashboard: https://grafana.com/grafana/dashboards/15361-icinga2-with-influxdb/

two more influxv2 query examples:

from(bucket: "icinga")
  |> range(start: v.timeRangeStart, stop:v.timeRangeStop)
  |> filter(fn: (r) =>
    r._measurement == "Invoke-IcingaCheckCPU" and
    r._field == "value" and
    r.metric == "total::ifw_cpu::load" and
    r.hostname == "${hostname}"
  |> map(fn: (r) => ({ _value:r._value, _time:r._time, _field: "total_cpu_usage" }))

from(bucket: "icinga2")
  |> range(start: v.timeRangeStart, stop:v.timeRangeStop)
  |> filter(fn: (r) =>
    r._measurement =~ /snmp-memory|snmp-storage/ and
    r._field == "value" and
    r.hostname == "${hostname}" and
    r.service == "${service}"
  |> map(fn: (r) => ({ _value:r._value, _time:r._time, _field: r.metric }))

Also you can use the InfluxDBv2 webinterface for building queries.

Ok, got some things to work, followed the Image renderer troubleshooting guide, generated new serviceaccount token, added correct Default dashboard UID. Icingaweb2-module-grafana render images, but no data shows up, just the empty rendred image. I use the default dashboard from Icingaweb2-module-grafana (icinga2-default.json), just imported and saved in grafana. Do I have to adjust the dashboard to be able to get it to work? Or use another dashboard in Icingaweb2-module-grafana? I have to admit quite new to influxdb2 so, not yet got to understand the new queries/flux.

It depends :slight_smile:

If you intend to use the Flux query language for InfluxDB2 (they deprecated the InfluxQL one with version 2) the default ones here do not work (they use InfluxQL) and you have to create the same logic in Flux (similar to the post of @log1c ).

You could use the old interface though but you would have to activate it in InfluxDB.

Fixed some syntactical errors in the last sentence

Found this for converting: https://influxql2flux.twentyfive.dev

No luck with converting icinga2-default nor icinga2-influxdb-host that is very useful due to it generates dynamic service graphs depending hosts active services. Got stuck with converting service and command variables. If you dont use icinga2-default for the module what is the best choise when using influxdb2?

I did not get this part :slight_smile:

Same problem: Icingaweb2 & grafana & influxdb working dashboard Hope someone should share their setup to get it working. :slight_smile:

I guess you will have to update the dashboards data source to get results.

Have you logged into the InfluxDB webinterface and tried the query builder? The interface should be running on port 8086 by default.