Fix problem notifications while flapping is active

fixes #9969
fixes #9642
This commit is contained in:
Sebastian Chrostek 2016-02-22 19:43:44 +01:00 committed by Michael Friedrich
parent 071c43c4da
commit f5f0f7bd6e
1 changed files with 14 additions and 12 deletions

View File

@ -346,6 +346,7 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
if (send_downtime_notification)
OnNotificationsRequested(this, in_downtime ? NotificationDowntimeStart : NotificationDowntimeEnd, cr, "", "");
if (send_notification) {
if (!was_flapping && is_flapping) {
OnNotificationsRequested(this, NotificationFlappingStart, cr, "", "");
@ -360,9 +361,10 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
<< "Flapping: Checkable " << GetName() << " stopped flapping (" << GetFlappingThreshold() << "% >= " << GetFlappingCurrent() << "%).";
NotifyFlapping(origin);
} else if (send_notification)
} else if (!was_flapping && !is_flapping)
OnNotificationsRequested(this, recovery ? NotificationRecovery : NotificationProblem, cr, "", "");
}
}
void Checkable::ExecuteRemoteCheck(const Dictionary::Ptr& resolvedMacros)
{