[icinga-checkins] icinga.org: icinga-core/r1.2: core: fix first_notification_delay logic ( GalaxyMaster) #1145

git at icinga.org git at icinga.org
Wed Jan 26 14:01:57 CET 2011


Module: icinga-core
Branch: r1.2
Commit: fc202f9950252853d97c65e8a54535bf7131b43b
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=fc202f9950252853d97c65e8a54535bf7131b43b

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Tue Jan 25 14:54:24 2011 +0100

core: fix first_notification_delay logic (GalaxyMaster) #1145

[--SNIP--]
This patch fixes two errors of the same nature: a misplacement of the
closing brace. These errors prevented the first_notification_delay
logic to work. After my patch is applied, the delayed notifications
start to work as expected.

Tested-by: GalaxyMaster <galaxy at openwall.com>
Signed-off-by: Andreas Ericsson <ae at op5.se>

Author: GalaxyMaster <galaxy at openwall.com>
Committer: Andreas Ericsson <ae at op5.se>
[--SNIP--]

fixes #1145

---

 Changelog            |    1 +
 base/notifications.c |    4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Changelog b/Changelog
index 57e9f03..3aa8f45 100644
--- a/Changelog
+++ b/Changelog
@@ -29,6 +29,7 @@ FIXES
 * core: fix extraneous alerts for services when host is down (Ton Voon) #1097
 * core: fix bug with passive host checks being incorrectly sent to event brokers as active checks (Ethan Galstad) #1133
 * core: fix bug where passive host check status updates were not being propagated to event brokers (Ethan Galstad) #1134
+* core: fix first_notification_delay logic (GalaxyMaster) #1145
 
 * classic ui: change servicestatus letter color to default black, not grey #946
 * classic ui: fix waste of cpu in status summary (TomTom) #933
diff --git a/base/notifications.c b/base/notifications.c
index b7ff300..da5351c 100644
--- a/base/notifications.c
+++ b/base/notifications.c
@@ -557,7 +557,7 @@ int check_service_notification_viability(service *svc, int type, int options){
 		if((svc->last_time_critical < first_problem_time) && (svc->last_time_critical > svc->last_time_ok))
 			first_problem_time=svc->last_time_critical;
 
-		if(current_time < (time_t)((first_problem_time==(time_t)0L)?program_start:first_problem_time + (svc->first_notification_delay*interval_length))){
+		if(current_time < (time_t)((first_problem_time==(time_t)0L)?program_start:first_problem_time) + (time_t)(svc->first_notification_delay*interval_length)){
 			log_debug_info(DEBUGL_NOTIFICATIONS,1,"Not enough time has elapsed since the service changed to a non-OK state, so we should not notify about this problem yet\n");
 			return ERROR;
 		}
@@ -1622,7 +1622,7 @@ int check_host_notification_viability(host *hst, int type, int options){
 		if((hst->last_time_unreachable < first_problem_time) && (hst->last_time_unreachable > hst->last_time_unreachable))
 			first_problem_time=hst->last_time_unreachable;
 
-		if(current_time < (time_t)((first_problem_time==(time_t)0L)?program_start:first_problem_time + (hst->first_notification_delay*interval_length))){
+		if(current_time < (time_t)((first_problem_time==(time_t)0L)?program_start:first_problem_time) + (time_t)(hst->first_notification_delay*interval_length)){
 			log_debug_info(DEBUGL_NOTIFICATIONS,1,"Not enough time has elapsed since the host changed to a non-UP state (or since program start), so we shouldn't notify about this problem yet.\n");
 			return ERROR;
 		}





More information about the icinga-checkins mailing list