Skip to content

Commit

Permalink
Fix Flapping{Start,End} notifications in SOFT states or downtimes
Browse files Browse the repository at this point in the history
fixes #12560
fixes #12892
  • Loading branch information
Michael Friedrich authored and gunnarbeutner committed Nov 17, 2016
1 parent 5947133 commit 0610652
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/icinga/checkable-check.cpp
Expand Up @@ -365,15 +365,17 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
ExecuteEventHandler();

/* Flapping start/end notifications */
if (!was_flapping && is_flapping) {
if (send_notification && !was_flapping && is_flapping) {
/* FlappingStart notifications happen on state changes, not in downtimes */
if (!IsPaused())
OnNotificationsRequested(this, NotificationFlappingStart, cr, "", "", MessageOrigin::Ptr());

Log(LogNotice, "Checkable")
<< "Flapping: Checkable " << GetName() << " started flapping (" << GetFlappingThreshold() << "% < " << GetFlappingCurrent() << "%).";

NotifyFlapping(origin);
} else if (was_flapping && !is_flapping) {
} else if (!in_downtime && was_flapping && !is_flapping) {
/* FlappingEnd notifications are independent from state changes, must not happen in downtine */
if (!IsPaused())
OnNotificationsRequested(this, NotificationFlappingEnd, cr, "", "", MessageOrigin::Ptr());

Expand Down

0 comments on commit 0610652

Please sign in to comment.