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!