Icinga is not sending any metricts to InfluxDB

Hi all.

I have a running installation of Icinga2. It monitors different parameters in different servers without any issue.

My next step was to store all that readings into an InfluxDB database for further analysis and dashboard setup for our Support team.

I have installed InfluxDB in the same server as Icinga2 and IcingaWeb2.

InfluxDB is reachable via influx shell command.

In InfluxDB I have created a database named icinga2.

I’m able to inject fake measurement into influx using

curl -i -XPOST "http://localhost:8086/write?db=icinga2" --data-binary 'weather,location=us-midwest temperature=82 1465839830100400200'

On Icinga I have enabled the influxdb feature and restarted the service.

This is the contents of /etc/icinga2/features-enables/influxdb.conf

object InfluxdbWriter "influxdb" {
  host = "127.0.0.1"
  port = 8086
  database = "icinga2"
  host_template = {
    measurement = "$host.check_command$"
    tags = {
      hostname = "$host.name$"
    }
  }
  service_template = {
    measurement = "$service.check_command$"
    tags = {
      hostname = "$host.name$"
      service = "$service.name$"
    }
  }
}

Everything looks OK for me, but Icinga is not writing any data into InfluxDB

What I have forgotten?

Thanks in advance!!

Javier Vilarroig

I don’t see username and password in your influxdb.conf, not sure if this is working. You can check icinga.log for any errors.

Why would one need a username and password for Icinga, when the curl command
works fine without?

Antony.

Good point. Have overlooked this.

Hi,

which version of Icinga 2 and InfluxDB you are using? Are there any entries in the Icinga 2 log file about errors regarding the InfluxDB connection.

Best regards
Michael

Just one thought: InfluxDB Version 2 was released and I am sure, this is not implemented in Icinga2 yet. You have to use the latest Influx 1 Version.

1 Like

Hi.

Icinga2 is version 2.12.1
InfluxDB is version 1.0.2

In /var/log/icinga2/icinga2.log I’m getting every minute a line similar to

information/WorkQueue: #7 (InfluxdbWriter, influxdb) items: 0, rate: 1/s (60/min 298/5min 897/15min);

No errors. But nothing gets written in InfluxDB.

Using influx CLI I have checked icinga2 database and also _internal database but nothing is there.

error.log is empty.

I have activated debug in icinga2. The only mention to influxdb is in inserts into IDO where there ara attributes called influxdb.

Thanks!
Javier

Do you see any perfdata in Icingaweb2?

BTW: Your InfluxDB is pretty old, we ware using 1.8.

Yes, I have perfdata shown in Icingawed.

About the InfluxDB version. We are still in Debian 9 (old old stable), planning to migrate to Debian 10 in January. If this can be the issue I can take a look at backports to see if there is a more modern version.

In general my management is very cautious about upgrading :wink:

Thanks!

Why not getting it directly from https://repos.influxdata.com/?

Here a hint points to SELinux as possible root cause.

Interesting reading. I will go through it and share what I find.

Thanks!

Do you know if this is still the case, that influx 2.0 is not yet supported? I am running Icinga r2.12.3-1 and influx2.0 in a new build and am not seeing data being written.

I think so. I haven’t heard any different yet. But maybe @theFeu can give more detailed information here. I also don’t know, if grafana is already working with InfluxDB2

Hey there,

I went and asked one of our developers and it seems like we didn’t build a special implementation for InfluxDB 2.0
So if it doesn’t work out of the box with our InfluxDB writer, then I am afraid we don’t support it at the time of writing :slight_smile:

1 Like

As Icinga 2 uses the standard protocol of InfluxDB it should be no problem to use it with 2.0. Only if one of the other, now not directly supported protocols would be used, then a telegraf instance would be needed for translation. So if something does not work, it would still be worth investigating as it could be a bug in the protocol implementation or similar.

Unfortunately in German but a colleague wrote a quite note on how to connect Icinga 2 to InfluxDB 2: https://www.netways.de/blog/2021/01/28/icinga2-und-influx2-so-bringen-wir-beide-zum-reden/

Commands are included to create a version 1 compatible bucket and this should be enough. If an English version is required, please tell me and I will try my best to get one published.