It seems that Icinga DB is not running. Make sure Icinga DB is running and writing into the database

Hi,

We are trying to migrate from InoDB to IcingaDB but we get this error. Using a distributed setup:

mqde01icinga02: icingaweb2 + mysqld
mqde01icinga2cl01: icinga2+icingadb+icingadb-redis
mqde01icinga2cl02: icinga2+icingadb+icingadb-redis

In the logs I see that connection from both icinga2 nodes to mysql and redis databases are ok:

mqde01icinga2cl02 icingadb[8373]: Starting Icinga DB daemon (v1.2.0)
mqde01icinga2cl02 icingadb[8373]: Connecting to database at 'mqde01icinga02:0'
mqde01icinga2cl02 icingadb[8373]: Connecting to Redis at 'localhost:6380'
mqde01icinga2cl02 icingadb[8373]: Waiting for Icinga 2 to write into Redis, please make sure you have started Icinga 2 and the Icinga DB feature is enabled

mqde01icinga2cl01 icingadb[99262]: Starting Icinga DB daemon (v1.2.0)
mqde01icinga2cl01 icingadb[99262]: Connecting to database at 'mqde01icinga02:0'
mqde01icinga2cl01 icingadb[99262]: Connecting to Redis at 'localhost:6380'
mqde01icinga2cl01 icingadb[99262]: Waiting for Icinga 2 to write into Redis, please make sure you have started Icinga 2 and the Icinga DB feature is enabled

Health status errors:

Both icinga2 nodes have the icingadb feature enabled and service restarted:

root@mqde01icinga2cl01:~$ icinga2 feature list
Disabled features: compatlog debuglog elasticsearch gelf graphite icingastatus influxdb2 journald opentsdb statusdata syslog
Enabled features: api checker command icingadb ido-mysql influxdb livestatus mainlog notification perfdata

root@mqde01icinga2cl02:~$ icinga2 feature list
Disabled features: compatlog debuglog elasticsearch gelf graphite icingadb icingastatus influxdb2 journald opentsdb statusdata syslog
Enabled features: api checker command ido-mysql influxdb livestatus mainlog notification perfdata

When I validate redis configuration in icingadb module I get this message:

  • Icinga DB Web version (System - About): 1.1.3
  • Icinga Web 2 version (System - About): 2.12.1
  • Web browser: Firefox 115.14.0esr (64-bit)
  • Icinga 2 version (icinga2 --version): r2.14.2-1
  • Icinga DB version (icingadb --version): v1.2.0
  • PHP version used (php --version): 8.2.20
  • Server operating system and version: Debian 12

Any hint?

Thanks for your post.

Waiting for Icinga 2 to write into Redis, please make sure you have started Icinga 2 and the Icinga DB feature is enabled

This Icinga DB message indicates that it does not receive any information from Redis. To make it work, you have to configure the Redis as an IcingaDB object in your Icinga 2: Object Types - Icinga 2

Btw, the second master from your icinga2 feature list does not have “icingadb” enabled.

Furthermore, in your Icinga Web configuration screenshot, both the Primary and Secondary Icinga Master are having the same Redis Host configured. You might wanna alter the second one.

Thanks for the fast reply. I have fixed both issues, icingadb feature and secondary master redis host.

Regarding the configuration of Redis as IcingaDB object, where should I do that, which config file?

After enabling the Icinga DB feature in Icinga 2, the feature configuration should be symlinked to /etc/icinga2/features-enabled/icingadb.conf. The file should contain an initial IcingaDB feature configuration, which you might need to alter. Afterwards, restart Icinga 2.

Note that the Redis port in the Icinga ecosystem is 6380, which is not the Redis default port. However, if you are using the icingadb-redis package, there is nothing to reconfigure there.

Please also consult the Icinga 2 log for Icinga DB- or Redis-related error messages.

I can’t start anymore the icinga2 service after changing that file:

 icinga2[265416]: [2024-08-26 10:20:46 +0200] information/ConfigItem: Instantiated 93 UserGroups.
 icinga2[265416]: [2024-08-26 10:20:46 +0200] information/ConfigItem: Instantiated 61 ServiceGroups.
 icinga2[265416]: [2024-08-26 10:20:46 +0200] information/ConfigItem: Instantiated 4 TimePeriods.
 icinga2[265416]: [2024-08-26 10:20:46 +0200] information/ConfigItem: Instantiated 63166 Services.
 icinga2[265416]: [2024-08-26 10:20:46 +0200] information/ScriptGlobal: Dumping variables to file '/var/cache/icinga2/icinga2.vars'
 icinga2[265416]: [2024-08-26 10:20:46 +0200] critical/cli: Could not write vars file: Error: basic_ios::clear: iostream error
 systemd[1]: icinga2.service: Main process exited, code=exited, status=1/FAILURE
 systemd[1]: icinga2.service: Failed with result 'exit-code'.
 systemd[1]: Failed to start icinga2.service - Icinga host/service/network monitoring system.
 systemd[1]: icinga2.service: Consumed 1min 53.130s CPU time.

I’m using icingadb-redis package. This is the content of root@mqde01icinga2cl01:/var/log$ cd /etc/icinga2/features-enabled/icingadb.conf file:

object IcingaDB "icingadb" {
  host = "127.0.0.1"
  port = 6380
  //password = "xxx"
}

Ignore my previous message, /var fs got full, now everything works:

Thanks for your help!

1 Like