# Config sync and Zones

**URL:** <https://community.icinga.com/t/config-sync-and-zones/5498>\
**Category:** Icinga 2\
**Created:** [September 11, 2020, 5:16pm UTC](https://community.icinga.com/t/config-sync-and-zones/5498 "2020-09-11T17:16:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jason.agility](https://community.icinga.com/letter_avatar_proxy/v4/letter/j/4af34b/32.png) [@jason.agility](https://community.icinga.com/u/jason.agility)\
**Post date:** [September 11, 2020, 5:16pm UTC](https://community.icinga.com/t/config-sync-and-zones/5498/1 "2020-09-11T17:16:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jason.agility](https://community.icinga.com/letter_avatar_proxy/v4/letter/j/4af34b/32.png) [@jason.agility](https://community.icinga.com/u/jason.agility)\
**Post date:** [September 14, 2020, 2:00pm UTC](https://community.icinga.com/t/config-sync-and-zones/5498/2 "2020-09-14T14:00:44Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![homerjay](https://community.icinga.com/user_avatar/community.icinga.com/homerjay/32/377_2.png) [@homerjay](https://community.icinga.com/u/homerjay)\
**Post date:** [September 14, 2020, 3:17pm UTC](https://community.icinga.com/t/config-sync-and-zones/5498/3 "2020-09-14T15:17:23Z")

</div>

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):

```bash
# /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.:

```auto
# 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.

---

<div class="post-metadata">

**Author:** ![jason.agility](https://community.icinga.com/letter_avatar_proxy/v4/letter/j/4af34b/32.png) [@jason.agility](https://community.icinga.com/u/jason.agility)\
**Post date:** [September 14, 2020, 3:59pm UTC](https://community.icinga.com/t/config-sync-and-zones/5498/4 "2020-09-14T15:59:10Z")

</div>

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.
