mirror of https://github.com/Icinga/icinga2.git
Take host state into account when sending suppressed notifications
Checkable::FireSuppressedNotifications() compares the time of the current checkable with the last recovery time of parents to avoid notification right after a parent recovered and before the current checkable was checked. This commit makes this check also include to host if the checkable is a service. This makes the behavior consistent with the documentation that states there is an implicit dependency on the host (which isn't realized as implicitly generating a Dependency object unfortunately).
This commit is contained in:
parent
9644effe86
commit
51cd7e7b0b
|
@ -155,6 +155,17 @@ void Checkable::FireSuppressedNotifications()
|
|||
}
|
||||
|
||||
auto threshold (cr->GetExecutionStart());
|
||||
Host::Ptr host;
|
||||
Service::Ptr service;
|
||||
tie(host, service) = GetHostService(this);
|
||||
|
||||
if (service) {
|
||||
ObjectLock oLock (host);
|
||||
|
||||
if (!host->GetProblem() && host->GetLastStateChange() >= threshold) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
for (auto& dep : GetDependencies()) {
|
||||
auto parent (dep->GetParent());
|
||||
|
|
Loading…
Reference in New Issue