From: Gunnar Beutner Date: Thu, 21 Mar 2013 10:37:34 +0000 (+0100) Subject: More bugfixes for notifications. X-Git-Tag: v0.0.2~200 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=db8ac1431cb9819441ea6efd752eb247847649ca;p=icinga2 More bugfixes for notifications. --- diff --git a/lib/icinga/service-check.cpp b/lib/icinga/service-check.cpp index 0e92ede35..ecd87405b 100644 --- a/lib/icinga/service-check.cpp +++ b/lib/icinga/service-check.cpp @@ -502,6 +502,9 @@ void Service::ProcessCheckResult(const Dictionary::Ptr& cr) bool hardChange = (GetStateType() == StateTypeHard && old_stateType == StateTypeSoft); + if (old_state != GetState() && old_stateType == StateTypeHard && GetStateType() == StateTypeHard) + hardChange = true; + if (hardChange) SetLastHardStateChange(now); @@ -516,9 +519,6 @@ void Service::ProcessCheckResult(const Dictionary::Ptr& cr) if (old_state == StateOK && old_stateType == StateTypeSoft) send_notification = false; /* Don't send notifications for SOFT-OK -> HARD-OK. */ - if (old_state != StateOK && GetState() == StateOK && old_stateType == StateTypeHard && GetState() == StateTypeHard) - send_notification = true; /* Send notifications for hard recoveries. (HARD-NON-OK -> HARD-OK) */ - bool send_downtime_notification = m_LastInDowntime != in_downtime; m_LastInDowntime = in_downtime; Touch("last_in_downtime");