Closed willfurnell closed 1 year ago
Hello Will!
Is your agent a pure command endpoint (which doesn’t schedule checks by itself)?
Yes that is the case - checks are scheduled by the master/secondary
Then the only what matters are the commands in global zones. So the remote zone which doesn’t exist locally doesn’t matter due to lack of checkables and the local zone which doesn’t exist remotely just enables trusting the parent node.
Ah - so if I'm doing the top down config sync - I only actually need the global zones on the agents? (and the agents own zone?)
... and the parent one for trusting the parent node in case of a a pure command endpoint.
But then I don't understand @Al2Klimov - as the example shows I change the name of the parent zone to something random and it still works?
object Zone "fhfodfbhdjdjk" {
endpoints = [ "icinga-test-server1.example.ac.uk", "icinga-test-server2.example.ac.uk" ]
}
object Endpoint "icinga-test-agent2.example.ac.uk" {
}
object Zone "icinga-test-agent2.example.ac.uk" {
endpoints = [ "icinga-test-agent2.example.ac.uk" ]
parent = "fhfodfbhdjdjk"
}
whereas in this case the parent zone is named "icinga2-ha-zone" in reality on the server.
PoV: you're a pure agent.
Thank you - but how does the agent now what it's parent zone is if that's not specified in the zones.conf? How does it decide what it's parent zone is in step 4 please? Or does the name not matter - as long as the master servers are specified there? The parent zone specified in the client config does not need to match the zone name specified in the configuration on the master - as long as the master endpoints are specified like this?
endpoints = [ "icinga-test-server1.example.ac.uk", "icinga-test-server2.example.ac.uk" ]
Sorry for all the questions...
Amazing, thank you!
Describe the bug
If the zone name is changed on the agent, configuration is still synced without issues from the master.
I have a test master-master setup with a couple of agents. I originally set everything up with the zone name icinga2-ha-zone and I am testing what happens when I change this. I have renamed the zone to tier1-zone, and changed references to this on the masters, in the zones.d folder and on one of the agents.
On one of the agents, I left the zones.conf as-is to see what would happen. For some reason, it kept working fine. I then changed the zone name in the zones.conf on this agent to a random string fhfodfbhdjdjk, and it still kept working!
To Reproduce
Have the following configuration on the nodes: zones.conf on the config master:
agents.conf in the zones.d/zone-name/ on the config master:
zones.conf on the agent that still works after changing the zone name to a random string:
Check the logs on the agent - it will show that it is working fine and configuration is somehow being synced with a zone that does not exist:
Expected behavior
Changing the zone name to one that does not exist on the agent breaks configuration syncing - or a message is shown in the logs to note that it doesn't matter if the zone name on the agent is changed.
Your Environment
Include as many relevant details about the environment you experienced the problem in
icinga2 --version
): r2.13.6-1icinga2 feature list
): Server side: api checker ido-mysql mainlog notification Agent side: api checker mainlogicinga2 daemon -C
):