# Zone removal

**URL:** <https://community.icinga.com/t/zone-removal/6085>\
**Category:** Icinga 2\
**Tags:** zones\
**Created:** [November 17, 2020, 10:09pm UTC](https://community.icinga.com/t/zone-removal/6085 "2020-11-17T22:09:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![monigacom](https://community.icinga.com/letter_avatar_proxy/v4/letter/m/bb73d2/32.png) [@monigacom](https://community.icinga.com/u/monigacom)\
**Post date:** [November 17, 2020, 10:09pm UTC](https://community.icinga.com/t/zone-removal/6085/1 "2020-11-17T22:09:58Z")

</div>

Hi,

Does the zone removal involve only editing the ‘zones.conf’ on the master?

Does it remove the hosts/services files inside the zone directory?

Thanks

---

<div class="post-metadata">

**Author:** ![mcktr](https://community.icinga.com/user_avatar/community.icinga.com/mcktr/32/856_2.png) [@mcktr](https://community.icinga.com/u/mcktr)\
**Post date:** [November 18, 2020, 7:53am UTC](https://community.icinga.com/t/zone-removal/6085/2 "2020-11-18T07:53:07Z")

</div>

Hi,

when you want to remove a zone you have to delete the entries in the `zones.conf` on the master, but as well on the agent/satellite. If you leave the entries on the agent/satellite the node will constantly try to re-connect to the master (assuming the the agent/satellite establish the connection to the master).

The removal will not remove files beneath `/ec/icinga2/zones.d/yourzonename/`.

Best regards  
Michael

---

<div class="post-metadata">

**Author:** ![monigacom](https://community.icinga.com/letter_avatar_proxy/v4/letter/m/bb73d2/32.png) [@monigacom](https://community.icinga.com/u/monigacom)\
**Post date:** [November 18, 2020, 3:22pm UTC](https://community.icinga.com/t/zone-removal/6085/3 "2020-11-18T15:22:22Z")

</div>

Thanks Michael.

One last question…

The hosts/services would be removed from the monitoring/UI once the zone is removed. Is that correct?

Thanks

---

<div class="post-metadata">

**Author:** ![mcktr](https://community.icinga.com/user_avatar/community.icinga.com/mcktr/32/856_2.png) [@mcktr](https://community.icinga.com/u/mcktr)\
**Post date:** [November 19, 2020, 7:55am UTC](https://community.icinga.com/t/zone-removal/6085/4 "2020-11-19T07:55:17Z")

</div>

> [@monigacom](#):
>
> The hosts/services would be removed from the monitoring/UI once the zone is removed. Is that correct?

Once the zone is removed from the `zones.conf` the zone directory in `zones.d` will no longer be included, after a reload/restart the hosts/services from this zone should be gone in Icinga Web.

Best regards  
Michael

---

<div class="post-metadata">

**Author:** ![monigacom](https://community.icinga.com/letter_avatar_proxy/v4/letter/m/bb73d2/32.png) [@monigacom](https://community.icinga.com/u/monigacom)\
**Post date:** [November 19, 2020, 8:09pm UTC](https://community.icinga.com/t/zone-removal/6085/5 "2020-11-19T20:09:19Z")

</div>

It didn’t work. I think need to remove the zone directory under zones.d as well.

If I want to rename the zone directory to retain the config data, is it allowed?

---

<div class="post-metadata">

**Author:** ![mcktr](https://community.icinga.com/user_avatar/community.icinga.com/mcktr/32/856_2.png) [@mcktr](https://community.icinga.com/u/mcktr)\
**Post date:** [November 20, 2020, 8:08am UTC](https://community.icinga.com/t/zone-removal/6085/6 "2020-11-20T08:08:30Z")

</div>

Hi,

I just tested it, I removed a zone in my `zones.conf` file and the directory will be ignored. The hosts and services from this zone are also gone in my Icinga Web.

```auto
[2020-11-20 08:58:48 +0100] warning/config: Ignoring directory '/etc/icinga2/zones.d/master' for unknown zone 'master'.
[2020-11-20 08:58:48 +0100] warning/config: Ignoring directory '/var/lib/icinga2/api/zones/master' for unknown zone 'master'.

```

Which version of Icinga 2 you are running?

> [@monigacom](#):
>
> If I want to rename the zone directory to retain the config data, is it allowed?

It shouldn’t be a problem, but I wouldn’t do it since it can be confusing which configuration is active and which not. Why not move the configuration that you no longer need to another directory?

Best regards  
Michael

---

<div class="post-metadata">

**Author:** ![monigacom](https://community.icinga.com/letter_avatar_proxy/v4/letter/m/bb73d2/32.png) [@monigacom](https://community.icinga.com/u/monigacom)\
**Post date:** [November 20, 2020, 11:39pm UTC](https://community.icinga.com/t/zone-removal/6085/7 "2020-11-20T23:39:04Z")

</div>

It’s version 2.5. and a satellite zone to be removed

---

<div class="post-metadata">

**Author:** ![mcktr](https://community.icinga.com/user_avatar/community.icinga.com/mcktr/32/856_2.png) [@mcktr](https://community.icinga.com/u/mcktr)\
**Post date:** [November 23, 2020, 5:15pm UTC](https://community.icinga.com/t/zone-removal/6085/8 "2020-11-23T17:15:42Z")

</div>

Hi,

the version 2.5 is fairly old, I highly suggest updating it.

If I remember correctly there was a bug that involved empty zones. If you clean or delete a zone directory it will not be deleted internally. Do the following create a `empty.conf` in your zone and leave it empty, remove all other files from it or move it somewhere else, if you want to keep them.

Now reload the Icinga 2 daemon.

Best regards  
Michael
