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

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!

Does anyone have any ideas so far?

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.

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.

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!

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!

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
[settings]
hostdowntime_all_services = "1"
  1. use Icinga Web 2 UI

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

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

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

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

Thanks!

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

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