From e2941dbca864b84c681044569846e60042b7160d Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 5 Dec 2013 12:30:02 +0100 Subject: [PATCH 1/2] Make sure that TimePeriod segments are being merged properly. Refs #5268 --- lib/icinga/timeperiod.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/icinga/timeperiod.cpp b/lib/icinga/timeperiod.cpp index 8fe6b21e2..4b081af79 100644 --- a/lib/icinga/timeperiod.cpp +++ b/lib/icinga/timeperiod.cpp @@ -70,12 +70,12 @@ void TimePeriod::AddSegment(double begin, double end) if (segment->Get("begin") <= begin && segment->Get("end") >= end) return; /* New segment is fully contained in this segment. */ - if (segment->Get("begin") < begin && segment->Get("end") > begin) { + if (segment->Get("begin") <= begin && segment->Get("end") >= begin) { segment->Set("end", end); /* Extend an existing segment. */ return; } - if (segment->Get("begin") > begin && segment->Get("begin") < end) { + if (segment->Get("begin") >= begin && segment->Get("begin") <= end) { segment->Set("begin", begin); /* Extend an existing segment. */ return; } From bb652ff335192e0bb9b54c0cd476bb053bf1ca66 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 5 Dec 2013 12:30:39 +0100 Subject: [PATCH 2/2] Rename one of the example timeperiods. Refs #5268 --- etc/icinga2/conf.d/timeperiods.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/icinga2/conf.d/timeperiods.conf b/etc/icinga2/conf.d/timeperiods.conf index 1bc2f3f8a..ea8beb465 100644 --- a/etc/icinga2/conf.d/timeperiods.conf +++ b/etc/icinga2/conf.d/timeperiods.conf @@ -16,8 +16,8 @@ object TimePeriod "24x7" inherits "legacy-timeperiod" { } } -object TimePeriod "8x5" inherits "legacy-timeperiod" { - display_name = "Icinga 2 8x5 TimePeriod", +object TimePeriod "9to5" inherits "legacy-timeperiod" { + display_name = "Icinga 2 9to5 TimePeriod", ranges = { "monday" = "09:00-17:00", "tuesday" = "09:00-17:00",