Don't send notifications for services that are unreachable, in a downtime or acknowledged.

This commit is contained in:
Gunnar Beutner 2013-02-11 16:38:16 +01:00
parent 18ed997696
commit c6e8013238
3 changed files with 8 additions and 1 deletions

View File

@ -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);
}
}

View File

@ -190,6 +190,11 @@ void Service::SetAcknowledgement(AcknowledgementType acknowledgement)
Set("acknowledgement", static_cast<long>(acknowledgement));
}
bool Service::IsAcknowledged(void)
{
return GetAcknowledgement() != AcknowledgementNone;
}
double Service::GetAcknowledgementExpiry(void) const
{
Value value = Get("acknowledgement_expiry");

View File

@ -208,6 +208,7 @@ public:
static void ValidateDowntimeCache(void);
bool IsInDowntime(void) const;
bool IsAcknowledged(void);
/* Comments */
static int GetNextCommentID(void);