# Services keep sending email, when host is up, but in Downtime state

**URL:** <https://community.icinga.com/t/services-keep-sending-email-when-host-is-up-but-in-downtime-state/2394>\
**Category:** Icinga 2\
**Tags:** downtime\
**Created:** [September 30, 2019, 7:14pm UTC](https://community.icinga.com/t/services-keep-sending-email-when-host-is-up-but-in-downtime-state/2394 "2019-09-30T19:14:25Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![UMax](https://community.icinga.com/letter_avatar_proxy/v4/letter/u/a9a28c/32.png) [@UMax](https://community.icinga.com/u/UMax)\
**Post date:** [September 30, 2019, 7:14pm UTC](https://community.icinga.com/t/services-keep-sending-email-when-host-is-up-but-in-downtime-state/2394/1 "2019-09-30T19:14:25Z")

</div>

Hello people,

Please help to disable notifications from services, when host in downtime and UP. I tried to use dependencies like that:

```
apply Dependency "disable-service-notification" to Service {
   parent_host_name = host.name
   disable_notifications = true
   disable_checks = true //tried true/false
   ignore_soft_states = false //tried true/false
   states = [Up] //tried with and without
   assign where "team" in host.groups
}

```

Any help would be much appreciated!

---

<div class="post-metadata">

**Author:** ![UMax](https://community.icinga.com/letter_avatar_proxy/v4/letter/u/a9a28c/32.png) [@UMax](https://community.icinga.com/u/UMax)\
**Post date:** [October 1, 2019, 3:35am UTC](https://community.icinga.com/t/services-keep-sending-email-when-host-is-up-but-in-downtime-state/2394/2 "2019-10-01T03:35:01Z")

</div>

Does anyone have any ideas so far?

---

<div class="post-metadata">

**Author:** ![hamester\_citti](https://community.icinga.com/letter_avatar_proxy/v4/letter/h/ba8739/32.png) [@hamester\_citti](https://community.icinga.com/u/hamester_citti)\
**Post date:** [October 1, 2019, 5:12am UTC](https://community.icinga.com/t/services-keep-sending-email-when-host-is-up-but-in-downtime-state/2394/3 "2019-10-01T05:12:00Z")

</div>

Hi Max,

- your services always used by apply rule?
- what kind of downtime (icingaweb/ backend) do you use?
- does your assign rule match your hosts? I think there is the problem.

---

<div class="post-metadata">

**Author:** ![log1c](https://community.icinga.com/user_avatar/community.icinga.com/log1c/32/2071_2.png) [@log1c](https://community.icinga.com/u/log1c)\
**Post date:** [October 1, 2019, 6:49am UTC](https://community.icinga.com/t/services-keep-sending-email-when-host-is-up-but-in-downtime-state/2394/4 "2019-10-01T06:49:22Z")

</div>

I don’t really get what you are trying to do.

So you have a host, that has a downtime configured and is still UP. now services of the same host are critical and you want to stop those service sending emails?  
Then you will have to configure the downtime with “all services” set to true, so that the services also get the downtime.

For a service dependency you will need a parent service, afaik.

---

<div class="post-metadata">

**Author:** ![UMax](https://community.icinga.com/letter_avatar_proxy/v4/letter/u/a9a28c/32.png) [@UMax](https://community.icinga.com/u/UMax)\
**Post date:** [October 1, 2019, 6:37pm UTC](https://community.icinga.com/t/services-keep-sending-email-when-host-is-up-but-in-downtime-state/2394/5 "2019-10-01T18:37:00Z")

</div>

Hi Hendrik,

1. Yes, all of them are used by apply rule?
2. I tried IcingaWebUI and Thruk
3. I think so, is there any way to verify it?

Thanks!

---

<div class="post-metadata">

**Author:** ![UMax](https://community.icinga.com/letter_avatar_proxy/v4/letter/u/a9a28c/32.png) [@UMax](https://community.icinga.com/u/UMax)\
**Post date:** [October 1, 2019, 6:39pm UTC](https://community.icinga.com/t/services-keep-sending-email-when-host-is-up-but-in-downtime-state/2394/6 "2019-10-01T18:39:33Z")

</div>

I’m trying to set downtime for a bunch of hosts using Thruk, but services shouldn’t page on hosts in downtime state. Because it doesn’t make sense when someone is working on those hosts, and put downtime, that means services may flap or go critical time-to-time.

Using All Services checkbox in WebUI helps, but I’m using Thruk and there is no such button for multiple host selection.

Any help would be much appreciated!

---

<div class="post-metadata">

**Author:** ![log1c](https://community.icinga.com/user_avatar/community.icinga.com/log1c/32/2071_2.png) [@log1c](https://community.icinga.com/u/log1c)\
**Post date:** [October 2, 2019, 5:58am UTC](https://community.icinga.com/t/services-keep-sending-email-when-host-is-up-but-in-downtime-state/2394/7 "2019-10-02T05:58:56Z")

</div>

Then I see three possibilities, as you will have to set services in a downtime as well.

1. Use the API to configure the downtimes
2. set a default in `/etc/icingaweb2/modules/monitoring/config.ini`

```auto
[settings]
hostdowntime_all_services = "1"

```

1. use Icinga Web 2 UI

---

<div class="post-metadata">

**Author:** ![Napsty](https://community.icinga.com/user_avatar/community.icinga.com/napsty/32/781_2.png) [@Napsty](https://community.icinga.com/u/Napsty)\
**Post date:** [October 2, 2019, 8:47am UTC](https://community.icinga.com/t/services-keep-sending-email-when-host-is-up-but-in-downtime-state/2394/8 "2019-10-02T08:47:52Z")

</div>

You can directly apply downtimes to Service objects, too. Even if you use host’s custom variables to assign the rule.  
see the docs: [https://icinga.com/docs/icinga2/latest/doc/08-advanced-topics/#recurring-downtimes](https://icinga.com/docs/icinga2/latest/doc/08-advanced-topics/#recurring-downtimes)

```auto
apply ScheduledDowntime "my-fancy-downtime" to Service {
  author = "icingaadmin"
  comment = "Scheduled downtime for backup"

  ranges = {
    monday = "02:00-03:00"
    tuesday = "02:00-03:00"
    wednesday = "02:00-03:00"
    thursday = "02:00-03:00"
    friday = "02:00-03:00"
    saturday = "02:00-03:00"
    sunday = "02:00-03:00"
  }

  assign where "team" in host.groups
}

```

I have a parallel thread open right now. On at least one host, Icinga2 still sends notification, even if the services are in a downtime. On another one the notifications are not sent. See [PROBLEM notification sent during recurring downtime](https://community.icinga.com/t/problem-notification-sent-during-recurring-downtime/2373/4)

---

<div class="post-metadata">

**Author:** ![UMax](https://community.icinga.com/letter_avatar_proxy/v4/letter/u/a9a28c/32.png) [@UMax](https://community.icinga.com/u/UMax)\
**Post date:** [October 2, 2019, 1:37pm UTC](https://community.icinga.com/t/services-keep-sending-email-when-host-is-up-but-in-downtime-state/2394/9 "2019-10-02T13:37:47Z")

</div>

Thank you very much! Still trying to use Thruk, instead of Icinga Web2, as there are a few backends, Nagios and Icinga ☹

Any ideas why the dependency mentioned above doesn’t work?

Thanks!

---

<div class="post-metadata">

**Author:** ![log1c](https://community.icinga.com/user_avatar/community.icinga.com/log1c/32/2071_2.png) [@log1c](https://community.icinga.com/u/log1c)\
**Post date:** [October 2, 2019, 2:06pm UTC](https://community.icinga.com/t/services-keep-sending-email-when-host-is-up-but-in-downtime-state/2394/10 "2019-10-02T14:06:25Z")

</div>

> [@UMax](#):
>
> Any ideas why the dependency mentioned above doesn’t work?

> [@log1c](#):
>
> For a service dependency you will need a parent service, afaik.

Check:  
[https://icinga.com/docs/icinga2/latest/doc/03-monitoring-basics/#dependencies](https://icinga.com/docs/icinga2/latest/doc/03-monitoring-basics/#dependencies)

---

<div class="post-metadata">

**Author:** ![dnsmichi](https://community.icinga.com/user_avatar/community.icinga.com/dnsmichi/32/7721_2.png) [@dnsmichi](https://community.icinga.com/u/dnsmichi)\
**Post date:** [October 7, 2019, 11:25am UTC](https://community.icinga.com/t/services-keep-sending-email-when-host-is-up-but-in-downtime-state/2394/11 "2019-10-07T11:25:25Z")

</div>

For reference, this seems to be the same question as in [https://github.com/Icinga/icinga2/issues/7551](https://github.com/Icinga/icinga2/issues/7551) and also asked via [info@icinga.com](mailto:info@icinga.com)
