Ignoring config update from endpoint 'Host1' for unknown zone 'Zone1'

Hello,

I have a problem with my Icinga environment.
My environment currently consists of only one master (Master Zone) and one agent (Windows) (Zone1).

zones.conf

object Endpoint "MasterFQDN" {
  host = "1.2.3.4"
}

object Zone "master" {
        endpoints = [ "MasterFQDN" ]
}

object Endpoint "AgentFQDN" {
  host = "4.3.2.1"
}

object Zone "Zone1" {
  endpoints = [ "AgentFQDN" ]
  parent = "master"
}

object Zone "global-templates" {
        global = true
}

object Zone "director-global" {
        global = true
}

On the master I have therefore created the following folders under /etc/icinga2/zones.d “master” and "Zone1

Now we come to my problem.
In the icinga2.log on the master I don’t get any errors, and I also see that the agent is successfully in its zone and connected to the master.

Master Log:

[2023-10-09 09:48:45 +0000] information/ApiListener: Finished reconnecting to endpoint 'AgentFQDN' via host '4.3.2.1' and port '5665'
[2023-10-09 09:48:45 +0000] information/ApiListener: Finished sending config file updates for endpoint 'AgentFQDN' in zone 'Zone1'.

In the Icinga2 web interface, the host is displayed normally and is also pingable.
Unfortunately, my service checks, such as a Windows service check, do not work. These remain unchanged in the status “pending”.
image

While searching for the error, I looked at the Windows Eventviewer logs on the agent and found a strange log entry that contradicts the log from the master:

Agent Log:
warning/ApiListener: Ignoring config update from endpoint 'MasterFQDN' for unknown zone 'Zone1'.

I found similar articles in the forum, but I could not apply the solutions to my environment.

Is it possible that I “incorrectly” ran the Icinga setup on the agent?

My Setup looks like this:

  1. host via. icinga2 pki ticket --cn AgentFQDN added and CSR ticket entered.
  2. port activated

Is it necessary that I enter the zone where the host is located in the agent setup under “Global Zones”?
image

Thank you for your help. :slightly_smiling_face:

Hello @cldx!

Please share your Windows zones.conf, under %ProgramData% > Icinga 2 > etc > icinga2.

Best,
A/K

Hello @Al2Klimov
here the zones.conf from %ProgramData%

/*
 * Generated by Icinga 2 node setup commands
 * on 2023-09-26 13:43:56 +0200
 */

object Endpoint "MasterFQDN" {
	host = "MasterFQDN"
	port = "5665"
}

object Zone "master" {
	endpoints = [ "MasterFQDN" ]
}

object Endpoint "AgentFQDN" {
}

object Zone "AgentFQDN" {
	endpoints = [ "AgentFQDN" ]
	parent = "master"
}

object Zone "global-templates" {
	global = true
}

object Zone "director-global" {
	global = true
}

There are some differences between the zones.conf from the agent and the master.

e.g.

object Zone "AgentFQDN" {
	endpoints = [ "AgentFQDN" ]
	parent = "master"
}

It should be:

object Zone "Zone1" {
  endpoints = [ "AgentFQDN" ]
  parent = "master"
}

Or the Endpoint Config is here like:

object Endpoint "MasterFQDN" {
	host = "MasterFQDN"
	port = "5665"
}

But should be:

object Endpoint "MasterFQDN" {
  host = "1.2.3.4"
}

Can you rename Zone1 to AgentFQDN?

You mean in the master’s zone.conf?

1 Like

I changed the configuration on master site now and reinstalled the icinga agent on the windows client again.
When uninstalling icinga2 on the Windows Agent, I also deleted all packages and folders to get a clean new state.
Master zones.conf looks now like:

object Endpoint "MasterFQDN" {
  host = "1.2.3.4"
}

object Zone "master" {
        endpoints = [ "MasterFQDN" ]
}

object Endpoint "AgentFQDN" {
  host = "4.3.2.1"
}

object Zone "AgentFQDN" {
  endpoints = [ "AgentFQDN" ]
  parent = "master"
}

object Zone "global-templates" {
        global = true
}

object Zone "director-global" {
        global = true
}

Windows Agent did applied the changes now, but I get now some error messages in the Windows Logs:

critical/config: Error: Object 'AgentFQDN' of type 'Host' re-defined: in C:/ProgramData/icinga2/var/lib/icinga2/api/zones-stage/AgentFQDN/_etc/hosts.conf: 6:1-6:40; previous definition: in C:\ProgramData\icinga2\etc\icinga2/conf.d/hosts.conf: 18:1-18:20
Location: in C:/ProgramData/icinga2/var/lib/icinga2/api/zones-stage/AgentFQDN/_etc/hosts.conf: 6:1-6:40
C:/ProgramData/icinga2/var/lib/icinga2/api/zones-stage/AgentFQDN/_etc/hosts.conf(4): }
C:/ProgramData/icinga2/var/lib/icinga2/api/zones-stage/AgentFQDN/_etc/hosts.conf(5): 
C:/ProgramData/icinga2/var/lib/icinga2/api/zones-stage/AgentFQDN/_etc/hosts.conf(6): object Host "AgentFQDN" {
                                                                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
C:/ProgramData/icinga2/var/lib/icinga2/api/zones-stage/AgentFQDN/_etc/hosts.conf(7):   display_name = "XYZ"
C:/ProgramData/icinga2/var/lib/icinga2/api/zones-stage/AgentFQDN/_etc/hosts.conf(8):   check_command = "hostalive"

critical/cli: Config validation failed. Re-run with 'icinga2 daemon -C' after fixing the config.

critical/ApiListener: Config validation failed for staged cluster config sync in 'C:\ProgramData\icinga2\var\lib\icinga2/api/zones-stage/'. Aborting. Logs: 'C:\ProgramData\icinga2\var\lib\icinga2/api//zones-stage-startup-last-failed.log'

When I run icinga2 daemon -C on the master, everything is fine.

Before uninstalling I removed althoug all folder from icinga that

Im not sure about the folder structure on the masters /etc/icinga2/zones.d

I have now two zones in my zones.conf:

  • master
  • AgentFQDN

So my Folder sctructure in the /etc/icinga2/zones.d contains only the two folders that “master” & “AgentFQDN” exactly like the zones.conf File?

Thank your for your help.

Have you checked the box in the bottom right corner?

1 Like

Hi,
no I havent checked this box in the past setups.
I have now the following settings:

And now its working fine!
Thank you very much, you made my day :slight_smile:

Love the icinga Community. :slight_smile: