# Recurring downtime for HostGroups

**URL:** <https://community.icinga.com/t/recurring-downtime-for-hostgroups/7519>\
**Category:** Icinga 2\
**Created:** [June 7, 2021, 11:18pm UTC](https://community.icinga.com/t/recurring-downtime-for-hostgroups/7519 "2021-06-07T23:18:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fv101](https://community.icinga.com/letter_avatar_proxy/v4/letter/f/838e76/32.png) [@fv101](https://community.icinga.com/u/fv101)\
**Post date:** [June 7, 2021, 11:18pm UTC](https://community.icinga.com/t/recurring-downtime-for-hostgroups/7519/1 "2021-06-07T23:18:51Z")

</div>

Is there a way to apply a recurring downtime to a Hostgroups? The documentation says hosts and services only, but has no mentioned of Hostgroups.

I’ve tried

```auto
apply ScheduledDowntime "weekly-maintenance" to HostGroups {
  author = "admin"
  comment = "Weekly Maintenance"
  ranges = {
    friday = "12:00-15:00"
  }
  assign where host.groups == "Linux_HostGroups"
}

```

However, this fails the `icinga2 daemon -C" checks.

---

<div class="post-metadata">

**Author:** ![dgoetz](https://community.icinga.com/user_avatar/community.icinga.com/dgoetz/32/917_2.png) [@dgoetz](https://community.icinga.com/u/dgoetz)\
**Post date:** [June 8, 2021, 6:28am UTC](https://community.icinga.com/t/recurring-downtime-for-hostgroups/7519/2 "2021-06-08T06:28:59Z")

</div>

No, Hostgroups are just to group hosts, but you can apply it to all hosts in a group.

```auto
apply ScheduledDowntime "weekly-maintenance" to Hosts {
  author = "admin"
  comment = "Weekly Maintenance"
  ranges = {
    friday = "12:00-15:00"
  }
  assign where "Linux_HostGroups" in host.groups
}

```

I changed it back to `to Hosts` and the assign to use `in` as `host.groups` is an array and not a string.

---

<div class="post-metadata">

**Author:** ![fv101](https://community.icinga.com/letter_avatar_proxy/v4/letter/f/838e76/32.png) [@fv101](https://community.icinga.com/u/fv101)\
**Post date:** [June 25, 2021, 2:53pm UTC](https://community.icinga.com/t/recurring-downtime-for-hostgroups/7519/3 "2021-06-25T14:53:12Z")

</div>

Thank you! I’ll have to give this a try once I have some more free time.
