Zone.d folder

Hi all, reading the documentation “Master with client scenario”, we create the folder zone.d/master.

In the chapter Top Down Config Sync we create a folder zone.d/fqdn.

I think it would be good to spend some more words about zone.d folder.
At first I thought you could put any file.conf in it but like in the conf.d folder (so no matter about subfolders) but it seems you have to create subfolders named the same way of a zone.
This folder is also not mentioned in /etc/icinga2/icinga2.conf.
Could you please explicitly write all details about zone.d folder?

Thank you.

Hi,

ok, where should this detail be put … inside the cluster config sync chapter, or anywhere else? The text already contains so many details that you are literally forced to try things out.

Maybe you want to create a PR on GitHub with your proposed changes :slight_smile:

Cheers,
Michael

Hi, I did some tests to better understand the use of zone.d folder and I’d like to share them with you.

systemctl stop icinga2
mv /etc/icinga2/zones.d/master/ /etc/icinga2/zones.d/test/

icinga2 daemon -C
critical/config: Error: Validation failed for object 'client1.domain.com' of type 'Zone'; Attribute 'zone': Object 'test' of type 'Zone' does not exist.
Location: in /etc/icinga2/zones.d/test/client1.domain.com.conf: 4:1-4:43

This test shows that the folder name of the folder is important and it has to match a zone name.

I tried to create an epmpty folder

mkdir /etc/icinga2/zones.d/fake/

checking the config it gives no errors.

Now I try to recreate master folder and move the previous test folder that contains the configuration files in it.

mkdir /etc/icinga2/zones.d/master/
mv /etc/icinga2/zones.d/test/ /etc/icinga2/zones.d/master/
ls /etc/icinga2/zones.d/master/test/
  client1.domain.com.conf
  ...


icinga2 daemon -C
<no error reported>

This test seems to explain that subfolders of a zone has no meaning.

The last test I did was moving the configuration file of master zone directly under zone.d:

systemctl stop icinga2
mv /etc/icinga2/zone.d/master /etc/icinga2/zone.d/
icinga2 -C
<no errors>

The only symptom I noticed is in icinga2.log of master

warning/JsonRpcConnection: API client disconnected for identity 'client1.domain.com'
information/ApiListener: New client connection for identity 'clien1.domain.com' from [1.2.3.4]:39888 (no Endpoint object found for identity)