Config sync and Zones

I am working on moving to the icinga2 native agent , and testing things out in a dummy environment.
My question/confusion is about what folders / files are sync via config sync.
i have a “master” zone and a “global-templates” zone.
zones.conf on the icinga2 master only has the global-templates and master zone configured (plus the icinga2 master endpoint), all the agent zones and endpoints are in zones.d/master/agents.conf
I added a new CheckCommand object to a file linux-commands.conf inside zones.d/master. But the command is never sync. It seems that only the contents of the global-templates directory is sync’ed.

Is only global-templates sync’ed?
should i configure the master zone as global=true?
do I only put check commands in multiple files inside global-templates? even though some commands are not global?

Thanks

I have double checked the documentation, but my questions still stand as un answered. Anyone have any insight as to what exactly gets sync’ed?

Hi.

I understand that this is quite confusing.

First of all:
No, you should not define the master zone as global-zone.


Wording for the following:
master: the icinga2 master
master-zone: the zone named master
agent: an endpoint in the master zone


  • The agents/endpoints only need to know about the CheckCommands - nothing else
  • Only the master has a directory named /etc/icinga2/zones.d/global-templates and /etc/icinga2/zones.d/master
    Example (partially):
# /etc/icinga2/zones.d on the master:
# tree -L 1
├── global-templates
├── master
  • master and endpoints all need to have the global-templates defined as global-zone, e.g.:
# Part of /etc/icinga2/zones.conf of master or endpoint
object Zone "global-templates"  {
  global = true
}
  • objects inside the global-templates directory of the master will be synced with all endpoints.
    So it has to contain CheckCommand definitions use by the endpoints (it doesn’t have to contain anything else)
  • Directory: /etc/icinga2/zones.d/master contains Endpoint, Host and Zone-Definitions.
    Sidenote: The definitions can be split in multiple files. The files have to end with .conf to be recognized

Greetings.

Thank you very much for the response. You have answered my questions and clarified how the top down config sync works. I can now organize my files correctly.

1 Like