Hi
I’m following the icinga2 dependency to set up service to service dependency. By looking at the log, it seems the dependency is taking effect, but somehow we still get the notification regardless.
My configuration is very standard, it looks like below. Based on the debug log, I see the depedency state matched, and the reachability is updated to not reachable, but it still sends out the notification (the actual values in the config and logs are replaced with token so that not to disclose internal info):
object Dependency "{{dependency-obj-name}}" {
parent_host_name = "{{parent_host_name}}"
parent_service_name = "{{parent_service_name}}"
child_host_name = "{{child_host_name}}"
child_service_name = "{{child_service_name}}"
states = [ Critical, Unknown ]
ignore_soft_states = true
disable_checks = false
disable_notifications = true
}
[2020-05-26 16:53:00 -0700] debug/DbEvents: Updating reachability for checkable '{{child-host-name}}!{{child-service-name}}': not reachable.
[2020-05-26 16:53:25 -0700] debug/DbEvents: Updating reachability for checkable '{{child-host-name}}!{{child-service-name}}': not reachable.
[2020-05-26 16:53:34 -0700] debug/DbEvents: Updating reachability for checkable '{{child-host-name}}!{{child-service-name}}': not reachable.
[2020-05-26 16:53:58 -0700] notice/Dependency: Dependency '{{child-host-name}}!{{child-service-name}}!{{dependency-object-name}}' passed: Parent service '{{parent-host-name}}!{{parent-service-name}}' matches state filter.
[2020-05-26 16:53:58 -0700] debug/CheckerComponent: Executing check for '{{child-host-name}}!{{child-service-name}}'
[2020-05-26 16:53:58 -0700] notice/Dependency: Dependency '{{child-host-name}}!{{child-service-name}}!{{dependency-object-name}}' passed: Parent service '{{parent-host-name}}!{{parent-service-name}}' matches state filter.
[2020-05-26 16:53:58 -0700] debug/CheckerComponent: Check finished for object '{{child-host-name}}!{{child-service-name}}'
[2020-05-26 16:53:58 -0700] notice/Dependency: Dependency '{{child-host-name}}!{{child-service-name}}!{{dependency-object-name}}' passed: Parent service '{{parent-host-name}}!{{parent-service-name}}' matches state filter.
[2020-05-26 16:53:58 -0700] notice/Dependency: Dependency '{{child-host-name}}!{{child-service-name}}!{{dependency-object-name}}' passed: Parent service '{{parent-host-name}}!{{parent-service-name}}' matches state filter.
[2020-05-26 16:53:58 -0700] debug/DbEvents: add log entry history for '{{child-host-name}}!{{child-service-name}}'
[2020-05-26 16:53:58 -0700] debug/DbEvents: add checkable check history for '{{child-host-name}}!{{child-service-name}}'
[2020-05-26 16:53:58 -0700] notice/Dependency: Dependency '{{child-host-name}}!{{child-service-name}}!{{dependency-object-name}}' passed: Parent service '{{parent-host-name}}!{{parent-service-name}}' matches state filter.
[2020-05-26 16:53:58 -0700] debug/DbEvents: add state change history for '{{child-host-name}}!{{child-service-name}}'
[2020-05-26 16:53:58 -0700] notice/Checkable: State Change: Checkable '{{child-host-name}}!{{child-service-name}}' soft state change from CRITICAL to CRITICAL detected.
[2020-05-26 16:54:33 -0700] debug/DbEvents: Updating reachability for checkable '{{child-host-name}}!{{child-service-name}}': not reachable.
[2020-05-26 16:54:56 -0700] notice/Dependency: Dependency '{{child-host-name}}!{{child-service-name}}!{{dependency-object-name}}' passed: Parent service '{{parent-host-name}}!{{parent-service-name}}' matches state filter.
[2020-05-26 16:54:56 -0700] debug/CheckerComponent: Executing check for '{{child-host-name}}!{{child-service-name}}'
[2020-05-26 16:54:56 -0700] notice/Dependency: Dependency '{{child-host-name}}!{{child-service-name}}!{{dependency-object-name}}' passed: Parent service '{{parent-host-name}}!{{parent-service-name}}' matches state filter.
[2020-05-26 16:54:56 -0700] debug/CheckerComponent: Check finished for object '{{child-host-name}}!{{child-service-name}}'
[2020-05-26 16:54:56 -0700] notice/Dependency: Dependency '{{child-host-name}}!{{child-service-name}}!{{dependency-object-name}}' passed: Parent service '{{parent-host-name}}!{{parent-service-name}}' matches state filter.
[2020-05-26 16:54:56 -0700] notice/Dependency: Dependency '{{child-host-name}}!{{child-service-name}}!{{dependency-object-name}}' passed: Parent service '{{parent-host-name}}!{{parent-service-name}}' matches state filter.
[2020-05-26 16:54:56 -0700] debug/DbEvents: add log entry history for '{{child-host-name}}!{{child-service-name}}'
[2020-05-26 16:54:56 -0700] debug/DbEvents: add checkable check history for '{{child-host-name}}!{{child-service-name}}'
[2020-05-26 16:54:56 -0700] notice/Dependency: Dependency '{{child-host-name}}!{{child-service-name}}!{{dependency-object-name}}' passed: Parent service '{{parent-host-name}}!{{parent-service-name}}' matches state filter.
[2020-05-26 16:54:56 -0700] debug/DbEvents: add state change history for '{{child-host-name}}!{{child-service-name}}'
[2020-05-26 16:54:56 -0700] notice/Checkable: State Change: Checkable '{{child-host-name}}!{{child-service-name}}' hard state change from CRITICAL to CRITICAL detected.
[2020-05-26 16:54:56 -0700] information/Checkable: Checking for configured notifications for object '{{child-host-name}}!{{child-service-name}}'
[2020-05-26 16:54:56 -0700] debug/Checkable: Checkable '{{child-host-name}}!{{child-service-name}}' has 1 notification(s).
[2020-05-26 16:54:56 -0700] notice/Notification: Attempting to send notifications for notification object '{{child-host-name}}!{{child-service-name}}!pagerduty-service'.
[2020-05-26 16:54:56 -0700] information/Notification: Sending 'Problem' notification '{{child-host-name}}!{{child-service-name}}!pagerduty-service' for user 'slack-ops'
[2020-05-26 16:54:56 -0700] information/Notification: Sending 'Problem' notification '{{child-host-name}}!{{child-service-name}}!pagerduty-service' for user 'ops-alerts'
[2020-05-26 16:54:56 -0700] information/Notification: Sending 'Problem' notification '{{child-host-name}}!{{child-service-name}}!pagerduty-service' for user 'pagerduty_ops'
[2020-05-26 16:54:56 -0700] debug/DbEvents: add notification history for '{{child-host-name}}!{{child-service-name}}'
[2020-05-26 16:54:56 -0700] debug/DbEvents: add contact notification history for service '{{child-host-name}}!{{child-service-name}}' and user 'slack-ops'.
[2020-05-26 16:54:56 -0700] debug/DbEvents: add contact notification history for service '{{child-host-name}}!{{child-service-name}}' and user 'ops-alerts'.
[2020-05-26 16:54:56 -0700] debug/DbEvents: add contact notification history for service '{{child-host-name}}!{{child-service-name}}' and user 'pagerduty_ops'.
[2020-05-26 16:54:56 -0700] debug/DbEvents: add log entry history for '{{child-host-name}}!{{child-service-name}}'
[2020-05-26 16:54:56 -0700] information/Notification: Completed sending 'Problem' notification '{{child-host-name}}!{{child-service-name}}!pagerduty-service' for checkable '{{child-host-name}}!{{child-service-name}}' and user 'slack-ops'.
[2020-05-26 16:54:56 -0700] debug/DbEvents: add log entry history for '{{child-host-name}}!{{child-service-name}}'
[2020-05-26 16:54:56 -0700] information/Notification: Completed sending 'Problem' notification '{{child-host-name}}!{{child-service-name}}!pagerduty-service' for checkable '{{child-host-name}}!{{child-service-name}}' and user 'ops-alerts'.
[2020-05-26 16:54:56 -0700] debug/DbEvents: add log entry history for '{{child-host-name}}!{{child-service-name}}'
[2020-05-26 16:54:56 -0700] information/Notification: Completed sending 'Problem' notification '{{child-host-name}}!{{child-service-name}}!pagerduty-service' for checkable '{{child-host-name}}!{{child-service-name}}' and user 'pagerduty_ops'.
[2020-05-26 16:55:31 -0700] debug/DbEvents: Updating reachability for checkable '{{child-host-name}}!{{child-service-name}}': not reachable.