mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 13:45:04 +02:00
Flapping{Start,End} notifications must not depend on state changes
fixes #11899
This commit is contained in:
parent
399ae42a8c
commit
cdd858a0ec
@ -370,27 +370,29 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
|
|||||||
if (send_downtime_notification && IsActive())
|
if (send_downtime_notification && IsActive())
|
||||||
OnNotificationsRequested(this, in_downtime ? NotificationDowntimeStart : NotificationDowntimeEnd, cr, "", "", MessageOrigin::Ptr());
|
OnNotificationsRequested(this, in_downtime ? NotificationDowntimeStart : NotificationDowntimeEnd, cr, "", "", MessageOrigin::Ptr());
|
||||||
|
|
||||||
if (send_notification) {
|
/* Flapping start/end notifications */
|
||||||
if (!was_flapping && is_flapping) {
|
if (!was_flapping && is_flapping) {
|
||||||
if (!IsPaused())
|
if (!IsPaused())
|
||||||
OnNotificationsRequested(this, NotificationFlappingStart, cr, "", "", MessageOrigin::Ptr());
|
OnNotificationsRequested(this, NotificationFlappingStart, cr, "", "", MessageOrigin::Ptr());
|
||||||
|
|
||||||
Log(LogNotice, "Checkable")
|
Log(LogNotice, "Checkable")
|
||||||
<< "Flapping: Checkable " << GetName() << " started flapping (" << GetFlappingThreshold() << "% < " << GetFlappingCurrent() << "%).";
|
<< "Flapping: Checkable " << GetName() << " started flapping (" << GetFlappingThreshold() << "% < " << GetFlappingCurrent() << "%).";
|
||||||
|
|
||||||
NotifyFlapping(origin);
|
NotifyFlapping(origin);
|
||||||
} else if (was_flapping && !is_flapping) {
|
} else if (was_flapping && !is_flapping) {
|
||||||
if (!IsPaused())
|
if (!IsPaused())
|
||||||
OnNotificationsRequested(this, NotificationFlappingEnd, cr, "", "", MessageOrigin::Ptr());
|
OnNotificationsRequested(this, NotificationFlappingEnd, cr, "", "", MessageOrigin::Ptr());
|
||||||
|
|
||||||
Log(LogNotice, "Checkable")
|
Log(LogNotice, "Checkable")
|
||||||
<< "Flapping: Checkable " << GetName() << " stopped flapping (" << GetFlappingThreshold() << "% >= " << GetFlappingCurrent() << "%).";
|
<< "Flapping: Checkable " << GetName() << " stopped flapping (" << GetFlappingThreshold() << "% >= " << GetFlappingCurrent() << "%).";
|
||||||
|
|
||||||
NotifyFlapping(origin);
|
NotifyFlapping(origin);
|
||||||
} else if (!was_flapping && !is_flapping) {
|
}
|
||||||
if (!IsPaused())
|
|
||||||
OnNotificationsRequested(this, recovery ? NotificationRecovery : NotificationProblem, cr, "", "", MessageOrigin::Ptr());
|
/* Problem notifications */
|
||||||
}
|
if (send_notification && !is_flapping) {
|
||||||
|
if (!IsPaused())
|
||||||
|
OnNotificationsRequested(this, recovery ? NotificationRecovery : NotificationProblem, cr, "", "", MessageOrigin::Ptr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user