No host or service shown on the icingaweb2 gui

Hello Guys

I’ve the strange problem that no hosts or services are shown in my icingaweb2 GUI.
I’ve a HA Master and HA Satellite setup. The endpoints are listed correctly, when I run the “icinga2 object list --type Endpoint” command on the servers.
The config check (icinga2 daemon -C) shows the correct number of host.
I validated the configurations (e.g resources )on the icingaweb2 GUI and they are working properly.
SELinux is disabled and I disabled the firewall for testing.
The debug log also is not showing any usefull output.
debug log:
[2020-02-13 10:09:30 +0100] notice/ApiListener: Current zone master: srv-icinga-master1.thaja.local
[2020-02-13 10:09:30 +0100] notice/ApiListener: Connected endpoints: srv-icinga-master2.thaja.local (1), srv-icinga-satellite2.thaja.local (1) and srv-icinga-satellite1.thaja.local (1)
[2020-02-13 10:09:31 +0100] notice/JsonRpcConnection: Received ‘event::Heartbeat’ message from identity ‘srv-icinga-satellite2.thaja.local’.
[2020-02-13 10:09:31 +0100] notice/JsonRpcConnection: Received ‘event::Heartbeat’ message from identity ‘srv-icinga-satellite1.thaja.local’.
[2020-02-13 10:09:31 +0100] notice/JsonRpcConnection: Received ‘log::SetLogPosition’ message from identity ‘srv-icinga-satellite2.thaja.local’.
[2020-02-13 10:09:32 +0100] notice/JsonRpcConnection: Received ‘log::SetLogPosition’ message from identity ‘srv-icinga-master2.thaja.local’.
[2020-02-13 10:09:32 +0100] notice/JsonRpcConnection: Received ‘event::Heartbeat’ message from identity ‘srv-icinga-master2.thaja.local’.
[2020-02-13 10:09:32 +0100] notice/JsonRpcConnection: Received ‘log::SetLogPosition’ message from identity ‘srv-icinga-satellite1.thaja.local’.

Do you have any clue what the problem could be?

BR
Thaja

HI,

how you configured your monitoring backend and your command transport? Maybe here is something wrong or something happend there. e.g. if your command transport would be api, is your api user still configured?

1 Like

Hi

I’m using the api user for command transport.

on master -->/etc/icinga2/conf.d/api-users.conf:
object ApiUser “icingaweb2” {
password = “PASSWORD”
permissions = [ “*” ]
}

on icingaweb2 --> /etc/icingaweb2/modules/monitoring/commandtransports.ini
[icinga2]
transport = “api”
host = “srv-icinga-master1.thaja.local”
port = “5665”
username = “icingaweb2”
password = “PASSWORD”

ok, if you use the directory “conf.d” for your configuration be sure, that this is NOT excluded in /etc/icinga2/icinga2.conf!! Because in the docs is often recommanded not to use this directory! Because here you find example configurations and can be overwritten during an update!

Better to use “api.conf” from “/etc/icinga2/features-available” and be sure you have enebled the api feature with icinga2 feature enable api

1 Like

Yes I know, but I have a exception in my icinga2.conf to include this file:
include “conf.d/api-users.conf”

so this should no be the issue

The api feature is already enabled

Did you test this user against the icinga api?

1 Like

Do you mean with testing the validation of the configuration on the webGUI, then yes

I mean this: https://icinga.com/docs/icinga2/latest/doc/12-icinga2-api/#authentication-test
So if you can query something with your "icingaweb2 user

1 Like

I tested it and it is working.

curl -k -s -u icingaweb2:PASSWORD ‘https://localhost:5665/v1

Icinga 2

Hello from Icinga 2 (Version: 2.11.2-1)!

You are authenticated as icingaweb2. Your user has the following permissions:

  • *

More information about API requests is available in the documentation.

ok if this work you could check the icingaweb2 log. You should find it here: /var/log/icingaweb2/icingaweb2.log.
You should configure like written here: https://icinga.com/docs/icingaweb2/latest/doc/03-Configuration/#logging-configuration

Maybe you will find here some log entries why it will not work

1 Like

And you also test the api user with the url you wrote in /etc/icingaweb2/modules/monitoring/commandtransports.ini

So your test should be not with localhost, it should be like
curl -k -s -u icingaweb2:PASSWORD ‘https:// srv-icinga-master1.thaja.local:5665/v1’
in your case

2 Likes

Do you know what I’m doing wrong. I don’t get any entries in the log file.

[logging]
log = “file”
level = “DEBUG”
file = “/var/log/icingaweb2/icingaweb2.log”

-rwxrwxrwx. 1 apache icingaweb2 0 Feb 13 12:32 icingaweb2.log

The api test worked again with the hostname
curl -k -s -u icingaweb2:PASSWORD https://srv-icinga-master1.thaja.local:5665/v1

Icinga 2

Hello from Icinga 2 (Version: 2.11.2-1)!

You are authenticated as icingaweb2. Your user has the following permissions:

  • *

More information about API requests is available in the documentation.

Maybe because there are no actions to log. Try to click arround to see actions in the log file.
try to do simple things in icingaweb2 like creating users, set permissions to test if icingaweb2 write entries in the file.
While doeing this you could also check the permissions of your web users

I tested a little bit but nothing special happend.
Even when I configure a local transport it is not showing any hosts on the GUI.

Hi,

more details needed.

  • icinga2 --version
  • zones.conf from both masters
  • icinga2 feature list
  • cat /etc/icinga2/features-enabled/ido-mysql.conf from both masters (replace sensitive details).
  • cat /etc/icingaweb2/resources.ini (remove sensitive details)
  • cat /etc/icingaweb2/module/monitoring/backends.ini

Cheers,
Michael

Hi Michael

icinga2 --version

icinga2 - The Icinga 2 network monitoring daemon (version: 2.11.2-1)

Copyright © 2012-2020 Icinga GmbH (https://icinga.com/)
License GPLv2+: GNU GPL version 2 or later http://gnu.org/licenses/gpl2.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

System information:
Platform: CentOS Linux
Platform version: 7 (Core)
Kernel: Linux
Kernel version: 3.10.0-1062.el7.x86_64
Architecture: x86_64

Build information:
Compiler: GNU 4.8.5
Build host: runner-LTrJQZ9N-project-322-concurrent-0

Application information:

General paths:
Config directory: /etc/icinga2
Data directory: /var/lib/icinga2
Log directory: /var/log/icinga2
Cache directory: /var/cache/icinga2
Spool directory: /var/spool/icinga2
Run directory: /run/icinga2

Old paths (deprecated):
Installation root: /usr
Sysconf directory: /etc
Run directory (base): /run
Local state directory: /var

Internal paths:
Package data directory: /usr/share/icinga2
State path: /var/lib/icinga2/icinga2.state
Modified attributes path: /var/lib/icinga2/modified-attributes.conf
Objects path: /var/cache/icinga2/icinga2.debug
Vars path: /var/cache/icinga2/icinga2.vars
PID path: /run/icinga2/icinga2.pid

icinga2 feature

Disabled features: command compatlog elasticsearch gelf graphite influxdb livestatus opentsdb perfdata statusdata syslog
Enabled features: api checker debuglog ido-mysql mainlog notification

ido-mysql master1:

object IdoMysqlConnection “ido-mysql” {
user = “icinga”
password = “PASSWORD”
host = “192.168.122.35”
database = “icinga”
}

ido-mysql master2:

object IdoMysqlConnection “ido-mysql” {
user = “icinga”
password = “PASSWORD”
host = “192.168.122.35”
database = “icinga”
}

resources.ini

[icingaweb_db]
type = “db”
db = “mysql”
host = “192.168.122.35”
port = “”
dbname = “icingaweb2”
username = “icingaweb2”
password = “PASSWORD”
charset =""
use_ssl = “0”
[icinga_ido]
type = “db”
db = “mysql”
host = “192.168.122.35”
port = “”
dbname = “icinga”
username = “icinga”
password = “PASSWORD”
charset =""
use_ssl = “0”

backends.ini

[icinga]
type = “ido”
resource = “icinga_ido”

FYI: I have a seperate DB server with the IP 192.168.122.35
BR
Thaja

Hi,

thanks, looks fine to me. The HA cluster should then have the IDO feature active on one master, likely master2.

Can you verify whether the database is being updated accordingly, e.g. with running the mentioned query here?

Also, which user is currently logged in, and which roles are configured in Icinga Web 2 for this user?
Configuration > Authentication > Roles

Cheers,
Michael

Good Morning

The IDO was feature was active on both masters, so I disabled it on the first one.
The mysql query gave me the needed output, as mentioned in the documents with the update every 10 seconds.
In the authentication config there was only my admin user with administrative rights, who is currently logged in.

Hosts still not appeard :confused:

BR
Thaja

Uhm, that shouldn’t be the case with this configuration. The IDO feature will be paused on one master, but still be activated. If you have that now disabled via feature command, the HA failover will not work.

Icinga Web 2 has specific status views which allow to export them as JSON, CSV. You can also add format=sql to the URL and extract the executed SQL. https://icinga.com/docs/icingaweb2/latest/doc/20-Advanced-Topics/#global-url-parameters

Use that to manually query the database and see what happens. Post your findings in detail here.

Cheers,
Michael

Without knowing and see your environment I’m out of ideas. But I’m sure @dnsmichi have ideas. I wish you luck to fix it. I’m also still interested what the problem was.