Standard info:
- Version: r2.13.0-1
- Debian 10
- Enabled features: api checker ido-pgsql mainlog notification
- Icinga Web 2 version: 2.9.3
- Icinga Web 2 modules: doc and monitoring, 2.9.3
[2021-08-12 21:48:28 +0000] information/cli: Icinga application loader (version: r2.13.0-1)
[2021-08-12 21:48:28 +0000] information/cli: Loading configuration file(s).
[2021-08-12 21:48:28 +0000] information/ConfigItem: Committing config item(s).
[2021-08-12 21:48:28 +0000] information/ApiListener: My API identity: myhostname
[2021-08-12 21:48:28 +0000] information/ConfigItem: Instantiated 12 Notifications.
[2021-08-12 21:48:28 +0000] information/ConfigItem: Instantiated 1 IcingaApplication.
[2021-08-12 21:48:28 +0000] information/ConfigItem: Instantiated 2 NotificationCommands.
[2021-08-12 21:48:28 +0000] information/ConfigItem: Instantiated 2 HostGroups.
[2021-08-12 21:48:28 +0000] information/ConfigItem: Instantiated 2 Hosts.
[2021-08-12 21:48:28 +0000] information/ConfigItem: Instantiated 1 FileLogger.
[2021-08-12 21:48:28 +0000] information/ConfigItem: Instantiated 1 CheckerComponent.
[2021-08-12 21:48:28 +0000] information/ConfigItem: Instantiated 1 ApiListener.
[2021-08-12 21:48:28 +0000] information/ConfigItem: Instantiated 4 Zones.
[2021-08-12 21:48:28 +0000] information/ConfigItem: Instantiated 2 Endpoints.
[2021-08-12 21:48:28 +0000] information/ConfigItem: Instantiated 1 IdoPgsqlConnection.
[2021-08-12 21:48:28 +0000] information/ConfigItem: Instantiated 2 ApiUsers.
[2021-08-12 21:48:28 +0000] information/ConfigItem: Instantiated 244 CheckCommands.
[2021-08-12 21:48:28 +0000] information/ConfigItem: Instantiated 1 NotificationComponent.
[2021-08-12 21:48:28 +0000] information/ConfigItem: Instantiated 1 UserGroup.
[2021-08-12 21:48:28 +0000] information/ConfigItem: Instantiated 1 User.
[2021-08-12 21:48:28 +0000] information/ConfigItem: Instantiated 3 TimePeriods.
[2021-08-12 21:48:28 +0000] information/ConfigItem: Instantiated 3 ServiceGroups.
[2021-08-12 21:48:28 +0000] information/ConfigItem: Instantiated 1 ScheduledDowntime.
[2021-08-12 21:48:28 +0000] information/ConfigItem: Instantiated 13 Services.
[2021-08-12 21:48:28 +0000] information/ScriptGlobal: Dumping variables to file '/var/cache/icinga2/icinga2.vars'
[2021-08-12 21:48:28 +0000] information/cli: Finished validating the configuration file(s).
Object 'master' of type 'Zone':
% declared in '/etc/icinga2/zones.conf', lines 6:1-6:20
* __name = "master"
* endpoints = [ "myhostname" ]
% = modified in '/etc/icinga2/zones.conf', lines 7:2-7:33
* global = false
* name = "master"
* package = "_etc"
* parent = ""
* source_location
* first_column = 1
* first_line = 6
* last_column = 20
* last_line = 6
* path = "/etc/icinga2/zones.conf"
* templates = [ "master" ]
% = modified in '/etc/icinga2/zones.conf', lines 6:1-6:20
* type = "Zone"
* zone = ""
Object 'myhostname' of type 'Endpoint':
% declared in '/etc/icinga2/zones.conf', lines 9:1-9:32
* __name = "myhostname"
* host = ""
* log_duration = 86400
* name = "myhostname"
* package = "_etc"
* port = "5665"
* source_location
* first_column = 1
* first_line = 9
* last_column = 32
* last_line = 9
* path = "/etc/icinga2/zones.conf"
* templates = [ "myhostname" ]
% = modified in '/etc/icinga2/zones.conf', lines 9:1-9:32
* type = "Endpoint"
* zone = ""
zones.d/master/hosts.conf:
object Host "myhostname" {
name = "myhostname"
/* Import the default host template defined in `templates.conf`. */
import "generic-host"
vars.agent_endpoint = name
/* Specify the address attributes for checks e.g. `ssh` or `http`. */
address = "localhost"
address6 = "::1"
/* Set custom variable `os` for hostgroup assignment in `groups.conf`. */
vars.os = "Linux"
/* Define http vhost attributes for service apply rules in `services.conf`. */
vars.http_vhosts["http"] = {
http_uri = "/"
}
vars.http_vhosts["Icinga Web 2"] = {
http_uri = "/icingaweb2"
}
/* Define disks and attributes for service apply rules in `services.conf`. */
vars.disks["disk"] = {
/* No parameters. */
}
vars.disks["disk /"] = {
disk_partitions = "/"
}
/* Define notification mail attributes for notification apply rules in `notifications.conf`. */
vars.notification["mail"] = {
/* The UserGroup `icingaadmins` is defined in `users.conf`. */
groups = [ "icingaadmins" ]
}
}
Prior to running the node wizard for master, icingaweb2 was happily displaying my host and the associated service checks. Once I did the wizard, I lost all of that. Having set up icinga before, I had a vague recollection that I needed to move everything into the zone instead of just conf.d, so I tried that. No luck. If I query the API directly as root, it shows no hosts. I am very confused. I added a node I was planning on monitoring to see if it would show up (config not shown above) and it also shows in the config verification (along with the master node) but not in the API:
curl -k -s -S -u root:mypasword 'https://localhost:5665/v1/objects/hosts' | jq
{
"results": []
}
I’m very confused as to why the hosts defined in the zone are not showing in the API at all. Incorrectly set up, errors, fine, but this is simply… nothing. And as shown in the config verification above the host does exist according to the master:
Object 'myhostname' of type 'Host':
% declared in '/etc/icinga2/zones.d/master/hosts.conf', lines 30:1-30:28
* __name = "myhostname"
* action_url = ""
* address = "localhost"
% = modified in '/etc/icinga2/zones.d/master/hosts.conf', lines 36:3-36:23
* address6 = "::1"
% = modified in '/etc/icinga2/zones.d/master/hosts.conf', lines 37:3-37:18
* check_command = "hostalive"
% = modified in '/etc/icinga2/zones.d/master/templates.conf', lines 19:3-19:29
* check_interval = 60
% = modified in '/etc/icinga2/zones.d/master/templates.conf', lines 16:3-16:21
* check_period = ""
* check_timeout = null
* command_endpoint = ""
* display_name = "myhostname"
* enable_active_checks = true
* enable_event_handler = true
* enable_flapping = false
* enable_notifications = true
* enable_passive_checks = true
* enable_perfdata = true
* event_command = ""
* flapping_ignore_states = null
* flapping_threshold = 0
* flapping_threshold_high = 30
* flapping_threshold_low = 25
* groups = [ ]
* icon_image = ""
* icon_image_alt = ""
* max_check_attempts = 3
% = modified in '/etc/icinga2/zones.d/master/templates.conf', lines 15:3-15:24
* name = "myhostname"
% = modified in '/etc/icinga2/zones.d/master/hosts.conf', lines 31:3-31:25
* notes = ""
* notes_url = ""
* package = "_etc"
* retry_interval = 30
% = modified in '/etc/icinga2/zones.d/master/templates.conf', lines 17:3-17:22
* source_location
* first_column = 1
* first_line = 30
* last_column = 28
* last_line = 30
* path = "/etc/icinga2/zones.d/master/hosts.conf"
* templates = [ "myhostname", "generic-host" ]
% = modified in '/etc/icinga2/zones.d/master/hosts.conf', lines 30:1-30:28
% = modified in '/etc/icinga2/zones.d/master/templates.conf', lines 14:1-14:28
* type = "Host"
* vars
* agent_endpoint = "myhostname"
% = modified in '/etc/icinga2/zones.d/master/hosts.conf', lines 34:3-34:28
* disks
* disk
% = modified in '/etc/icinga2/zones.d/master/hosts.conf', lines 51:3-53:3
* disk /
% = modified in '/etc/icinga2/zones.d/master/hosts.conf', lines 54:3-56:3
* disk_partitions = "/"
* http_vhosts
* Icinga Web 2
% = modified in '/etc/icinga2/zones.d/master/hosts.conf', lines 46:3-48:3
* http_uri = "/icingaweb2"
* http
% = modified in '/etc/icinga2/zones.d/master/hosts.conf', lines 43:3-45:3
* http_uri = "/"
* notification
* mail
% = modified in '/etc/icinga2/zones.d/master/hosts.conf', lines 59:3-62:3
* groups = [ "icingaadmins" ]
* os = "Linux"
% = modified in '/etc/icinga2/zones.d/master/hosts.conf', lines 40:3-40:19
* volatile = false
* zone = "master"
I’m sure this is quite a silly error, but I really have no idea where it is.