From 41d54029c82a73b5df05b36c2c595bfb147f0ade Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Wed, 8 Nov 2017 12:12:27 +0100 Subject: [PATCH] Fix log messages for flapping --- lib/icinga/checkable-check.cpp | 21 +++++++++++++-------- lib/icinga/checkable.hpp | 1 - 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/icinga/checkable-check.cpp b/lib/icinga/checkable-check.cpp index a89fa1463..893903ba4 100644 --- a/lib/icinga/checkable-check.cpp +++ b/lib/icinga/checkable-check.cpp @@ -332,12 +332,15 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig olock.Unlock(); -// Log(LogDebug, "Checkable") -// << "Flapping: Checkable " << GetName() -// << " was: " << (was_flapping) -// << " is: " << is_flapping) -// << " threshold: " << GetFlappingThreshold() -// << "% current: " + GetFlappingCurrent()) << "%."; +#ifdef I2_DEBUG /* I2_DEBUG */ + Log(LogDebug, "Checkable") + << "Flapping: Checkable " << GetName() + << " was: " << was_flapping + << " is: " << is_flapping + << " threshold low: " << GetFlappingThresholdLow() + << " threshold high: " << GetFlappingThresholdHigh() + << "% current: " << GetFlappingCurrent() << "%."; +#endif /* I2_DEBUG */ OnNewCheckResult(this, cr, origin); @@ -371,7 +374,8 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig OnNotificationsRequested(this, NotificationFlappingStart, cr, "", "", MessageOrigin::Ptr()); Log(LogNotice, "Checkable") - << "Flapping: Checkable '" << GetName() << "' started flapping (Current flapping value " << GetFlappingCurrent() << "% > threshold " << GetFlappingThresholdHigh() << "%)."; + << "Flapping Start: Checkable '" << GetName() << "' started flapping (Current flapping value " + << GetFlappingCurrent() << "% > high threshold " << GetFlappingThresholdHigh() << "%)."; NotifyFlapping(origin); } else if (!in_downtime && was_flapping && !is_flapping) { @@ -380,7 +384,8 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig OnNotificationsRequested(this, NotificationFlappingEnd, cr, "", "", MessageOrigin::Ptr()); Log(LogNotice, "Checkable") - << "Flapping: Checkable '" << GetName() << "' stopped flapping (Current flapping value " << GetFlappingCurrent() << "% < threshold " << GetFlappingThresholdLow() << "%)."; + << "Flapping Stop: Checkable '" << GetName() << "' stopped flapping (Current flapping value " + << GetFlappingCurrent() << "% < low threshold " << GetFlappingThresholdLow() << "%)."; NotifyFlapping(origin); } diff --git a/lib/icinga/checkable.hpp b/lib/icinga/checkable.hpp index 413e452d3..4060f1d00 100644 --- a/lib/icinga/checkable.hpp +++ b/lib/icinga/checkable.hpp @@ -239,7 +239,6 @@ private: /* Flapping */ void UpdateFlappingStatus(bool stateChange); - bool SuppressEvent(void) const; }; } -- 2.40.0