[icinga-checkins] icinga.org: icinga-core/mfriedrich/core: fix custom notifications being sent during downtimes (Sven Nierlein)

git at icinga.org git at icinga.org
Sun May 16 19:37:19 CEST 2010


Module: icinga-core
Branch: mfriedrich/core
Commit: 1c89a397fc48684adeb45277ea714c55ef5d10a4
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=1c89a397fc48684adeb45277ea714c55ef5d10a4

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Sun May 16 19:37:13 2010 +0200

fix custom notifications being sent during downtimes (Sven Nierlein)

fixes #355

---

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

diff --git a/Changelog b/Changelog
index 3280d30..1766bf1 100644
--- a/Changelog
+++ b/Changelog
@@ -19,6 +19,7 @@ ENHANCEMENTS
 
 FIXES
 * core: fix scheduling downtime for all services AND the host (cgi url, external commands)
+* core: fix custom notifications being sent during downtimes (Sven Nierlein)
 * core: fix spurious dollar signs added to command_lines (Alexander Wirt)
 * core: fix for choosing next valid time on day of DST change when clocks go one hour backwards (Ton Voon)
 * core: fix for nagios now erroring when "Error: Could not find any contactgroup matching..." displayed (Ton Voon)
diff --git a/base/notifications.c b/base/notifications.c
index 9b518bd..a7d6063 100644
--- a/base/notifications.c
+++ b/base/notifications.c
@@ -360,8 +360,13 @@ int check_service_notification_viability(service *svc, int type, int options){
 	/*********************************************/
 
 	/* custom notifications are good to go at this point... */
-	if(type==NOTIFICATION_CUSTOM)
+	if(type==NOTIFICATION_CUSTOM) {
+		if(svc->scheduled_downtime_depth>0 || temp_host->scheduled_downtime_depth>0){
+			log_debug_info(DEBUGL_NOTIFICATIONS,1,"We shouldn't send custom notification during scheduled downtime.\n");
+			return ERROR;
+		}
 		return OK;
+	}
 
 
 	/****************************************/





More information about the icinga-checkins mailing list