Suppress service notifications on host downtime

notifications
downtime
icinga2
(V) #1

Hello,

Any ideas how to suppress notifications for service alerts, if host currently is in downtime?

Thanks!

(H. Hamester) #2

Use the apply rules for your services :slight_smile:

OR

If you set a downtime there is an option for “all services”
Unbenannt

(V) #3

Thank you for your reply!

Could you please help me with the apply rules rule? Have read docs but didn’t find anything related to downtime :frowning:

Any help would be much appreciated!

Thanks!

(H. Hamester) #4

Have you seen this chapter?:

https://icinga.com/docs/icinga2/latest/doc/03-monitoring-basics/#using-apply

(Chris) #5

In this case i would consider to use dependencies if a host is down:
https://icinga.com/docs/icinga2/latest/doc/09-object-types/#dependency

You would need in this case a host to service dependency to disable notifications for example

(Reto Zeder) #6

Icinga 2 automatically adds an implicit dependency for services on their host. That way service notifications are suppressed when a host is DOWN or UNREACHABLE .

Icinga2 Implicit-Dependencies

So I’d rather click the checkbox to include the services while planing a downtime via Icingaweb

(pete) #7

just remember that if you end the host downtime before the expiration time, you’ll have to remove the downtime for all it’s services individually.

(V) #8

Hey guys,

I tried many ways to suppress notifications, when host is UP, but in DOWNTIME state. Still receiving notifications when service goes DOWN.

Tried also Dependencies, like:
apply Dependency “disable-service-notification” to Service {
disable_notifications = true
ignore_soft_states = true
assign where true
}

ignore_soft_state = false - doesn’t help as well. Still receiving notifications.

Please help

(V) #9

Log:

[2019-09-30 01:53:23 -0400] notice/Dependency: Dependency ‘domain.com!check-tcp443!disable-service-notification’ failed: Parent host ‘domain.com’ is in a soft state.
[2019-09-30 01:53:23 -0400] notice/Dependency: Dependency ‘domain.com!check-tcp443!disable-service-notification’ passed: Parent host ‘domain.com’ matches state filter.
[2019-09-30 01:53:23 -0400] debug/Checkable: Update checkable ‘domain.com!check-tcp443’ with check interval ‘300’ from last check time at 2019-09-30 01:53:23 -0400 (1.56982e+09) to next check time at 2019-09-30 01:58:16 -0400 (1.56982e+09).
[2019-09-30 01:53:23 -0400] notice/Checkable: State Change: Checkable ‘domain.com!check-tcp443’ hard state change from CRITICAL to CRITICAL detected.
[2019-09-30 01:53:23 -0400] information/Checkable: Checkable ‘domain.com!check-tcp443’ has 1 notification(s). Checking filters for type ‘Problem’, sends will be logged.
[2019-09-30 01:53:23 -0400] notice/Notification: Attempting to send notifications of type ‘Problem’ for notification object ‘domain.com!check-tcp443!notify-team-service’.
[2019-09-30 01:53:23 -0400] debug/Notification: User ‘team’ notification ‘domain.com!check-tcp443!notify-team-service’, Type ‘Problem’, TypeFilter: Problem and Recovery (FType=32, TypeFilter=96)
[2019-09-30 01:53:23 -0400] debug/Notification: User ‘team’ notification ‘domain.com!check-tcp443!notify-team-service’, State ‘Critical’, StateFilter: Critical, Down, OK and Up (FState=4, StateFilter=53)
[2019-09-30 01:53:23 -0400] information/Notification: Sending ‘Problem’ notification ‘domain.com!check-tcp443!notify-team-service’ for user ‘team’

Config dependency:

apply Dependency “disable-service-notification” to Service {
parent_host_name = host.name
disable_notifications = true
ignore_soft_states = false

assign where true
}

Config notification:

apply Notification “notify-team” to Service {
import “icinga-service”
assign where “team” in host.groups
states = [ Critical, OK ]
types = [ Problem, Recovery ]
user_groups = [ “group” ]
users = [ “team” ]
}

@dnsmichi, please help, trying to fix that a couple days so far :frowning:

Thanks in advance guys!

(V) #11

looks like I need to use

host.downtime_depth >= 1

somewhere. I just tried in Notifications and in dependency, it doesn’t help …

Please assist :frowning: