From 511b052105ae596c13cf1eb3aa928fb568d926b3 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Fri, 19 Jul 2013 11:02:43 +0200 Subject: [PATCH] Only check escalations for problem notifications. --- lib/icinga/notification.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/icinga/notification.cpp b/lib/icinga/notification.cpp index 80d17cb05..e083103fc 100644 --- a/lib/icinga/notification.cpp +++ b/lib/icinga/notification.cpp @@ -271,14 +271,16 @@ void Notification::BeginExecuteNotification(NotificationType type, const Diction Dictionary::Ptr times = GetTimes(); Service::Ptr service = GetService(); - if (times && times->Contains("begin") && now < service->GetLastHardStateChange() + times->Get("begin")) { - Log(LogInformation, "icinga", "Not sending notifications for notification object '" + GetName() + "': before escalation range"); - return; - } - - if (times && times->Contains("end") && now > service->GetLastHardStateChange() + times->Get("end")) { - Log(LogInformation, "icinga", "Not sending notifications for notification object '" + GetName() + "': after escalation range"); - return; + if (type == NotificationProblem) { + if (times && times->Contains("begin") && now < service->GetLastHardStateChange() + times->Get("begin")) { + Log(LogInformation, "icinga", "Not sending notifications for notification object '" + GetName() + "': before escalation range"); + return; + } + + if (times && times->Contains("end") && now > service->GetLastHardStateChange() + times->Get("end")) { + Log(LogInformation, "icinga", "Not sending notifications for notification object '" + GetName() + "': after escalation range"); + return; + } } unsigned long ftype = 1 << type; -- 2.40.0