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”.
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?
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?