diff --git a/lib/icinga/service-check.cpp b/lib/icinga/service-check.cpp index 5838bb9ee..a27d567b9 100644 --- a/lib/icinga/service-check.cpp +++ b/lib/icinga/service-check.cpp @@ -353,7 +353,8 @@ void Service::ApplyCheckResult(const Dictionary::Ptr& cr) * state/state_type attributes. */ DynamicObject::FlushTx(); - RequestNotifications(NotificationStateChange); + if (IsReachable() && !IsInDowntime() && !IsAcknowledged()) + RequestNotifications(NotificationStateChange); } } diff --git a/lib/icinga/service.cpp b/lib/icinga/service.cpp index bf712f971..26719f0ed 100644 --- a/lib/icinga/service.cpp +++ b/lib/icinga/service.cpp @@ -190,6 +190,11 @@ void Service::SetAcknowledgement(AcknowledgementType acknowledgement) Set("acknowledgement", static_cast(acknowledgement)); } +bool Service::IsAcknowledged(void) +{ + return GetAcknowledgement() != AcknowledgementNone; +} + double Service::GetAcknowledgementExpiry(void) const { Value value = Get("acknowledgement_expiry"); diff --git a/lib/icinga/service.h b/lib/icinga/service.h index d9f93fe6b..18826477e 100644 --- a/lib/icinga/service.h +++ b/lib/icinga/service.h @@ -208,6 +208,7 @@ public: static void ValidateDowntimeCache(void); bool IsInDowntime(void) const; + bool IsAcknowledged(void); /* Comments */ static int GetNextCommentID(void);