Remove zone config sync between master and client does not work

Hi all,

I’ve configured one master and some agents/clients on Debian 9 with 2.10.5-1.stretch. I wanted to achieve sync of check_commands between master and client and created a zone-directory with the FQDN of the client in /etc/icinga2/zones.d and the contents of that directory was synced to the client immediately.

How can I remove that sync?

systemctl stop icinga2.service
rm -rf /etc/icinga2/zones.d/FQDN
systemctl start icinga2.service

on the master does not remove the files on the client.

When I stop icinga2 on the client, remove the /var/lib/icinga2/api/zones/FQDN directory and start again - the directory will be synced again…

Regards
Stephan

Does icinga daemon -C on the master show any warnings or errors? Just to make sure there is no configuration issue that keeps icinga from successfully reloading and applying the new / current configuration.

no errors, no warnings:

root@ucsnetmon2:/etc/icinga2/zones.d# icinga2 daemon -C
[2019-07-24 12:27:25 +0200] information/cli: Icinga application loader (version: r2.10.5-1)
[2019-07-24 12:27:25 +0200] information/cli: Loading configuration file(s).
[2019-07-24 12:27:25 +0200] information/ConfigItem: Committing config item(s).
[2019-07-24 12:27:25 +0200] information/ApiListener: My API identity: ucsnetmon2.ltbbg1.lvnbb.de
[2019-07-24 12:27:25 +0200] information/ConfigItem: Instantiated 3 ScheduledDowntimes.
[2019-07-24 12:27:25 +0200] information/ConfigItem: Instantiated 411 Services.
[2019-07-24 12:27:25 +0200] information/ConfigItem: Instantiated 1 IcingaApplication.
[2019-07-24 12:27:25 +0200] information/ConfigItem: Instantiated 36 Hosts.
[2019-07-24 12:27:25 +0200] information/ConfigItem: Instantiated 1 FileLogger.
[2019-07-24 12:27:25 +0200] information/ConfigItem: Instantiated 2 NotificationCommands.
[2019-07-24 12:27:25 +0200] information/ConfigItem: Instantiated 9 Notifications.
[2019-07-24 12:27:25 +0200] information/ConfigItem: Instantiated 1 NotificationComponent.
[2019-07-24 12:27:25 +0200] information/ConfigItem: Instantiated 5 HostGroups.
[2019-07-24 12:27:25 +0200] information/ConfigItem: Instantiated 1 ApiListener.
[2019-07-24 12:27:25 +0200] information/ConfigItem: Instantiated 3 Downtimes.
[2019-07-24 12:27:25 +0200] information/ConfigItem: Instantiated 17 Comments.
[2019-07-24 12:27:25 +0200] information/ConfigItem: Instantiated 1 CheckerComponent.
[2019-07-24 12:27:25 +0200] information/ConfigItem: Instantiated 29 Zones.
[2019-07-24 12:27:25 +0200] information/ConfigItem: Instantiated 26 Endpoints.
[2019-07-24 12:27:25 +0200] information/ConfigItem: Instantiated 3 ApiUsers.
[2019-07-24 12:27:25 +0200] information/ConfigItem: Instantiated 1 User.
[2019-07-24 12:27:25 +0200] information/ConfigItem: Instantiated 1 IdoMysqlConnection.
[2019-07-24 12:27:25 +0200] information/ConfigItem: Instantiated 219 CheckCommands.
[2019-07-24 12:27:25 +0200] information/ConfigItem: Instantiated 1 UserGroup.
[2019-07-24 12:27:25 +0200] information/ConfigItem: Instantiated 5 ServiceGroups.
[2019-07-24 12:27:25 +0200] information/ConfigItem: Instantiated 2 TimePeriods.
[2019-07-24 12:27:25 +0200] information/ScriptGlobal: Dumping variables to file ‘/var/cache/icinga2/icinga2.vars’
[2019-07-24 12:27:25 +0200] information/cli: Finished validating the configuration file(s).

There is nor directory with FQDN in the path:

root@ucsnetmon2:/etc/icinga2/zones.d# ll
insgesamt 8
drwxr-xr-x 2 root root 4096 Jul 24 11:35 linux-commands
-rw-r–r-- 1 root root 133 Mär 19 13:00 README

Versions before 2.11 have a bug with including and syncing removed zones in the storage dir in /var/lib/icinga2/api/zones`. You’re safe to manually delete the corresponding zone directory from there and restart Icinga.