H_UP notification regarless scheduled downtime

Ricardo Jose Maraschini ricardo.maraschini at opservices.com.br
Tue Nov 6 14:42:51 CET 2012


Dear fellows,

Documentation states that:

"When a host or service is in a period of scheduled downtime, Nagios
will not allow normal notifications to be sent out for the host or
service."

But, apparently Nagios keep sending notifications for H_UP, regardless
if it's on scheduled downtimes or not. I've seen a running Nagios here
notify all host's contacts after a forced check and take a look at the
code(what i've found follow below). Anyone could help me to test the 
behaviour above? Is that an expected behaviour ?

Index: base/notifications.c
===================================================================
--- base/notifications.c	(revision 2450)
+++ base/notifications.c	(working copy)
@@ -1464,16 +1464,16 @@
 		return ERROR;
 		}
 
-	/***** RECOVERY NOTIFICATIONS ARE GOOD TO GO AT THIS POINT *****/
-	if(hst->current_state == HOST_UP)
-		return OK;
-
 	/* if this host is currently in a scheduled downtime period, don't send the notification */
 	if(hst->scheduled_downtime_depth > 0) {
 		log_debug_info(DEBUGL_NOTIFICATIONS, 1, "This host is currently in a scheduled downtime, so we won't send notifications.\n");
 		return ERROR;
 		}
 
+	/***** RECOVERY NOTIFICATIONS ARE GOOD TO GO AT THIS POINT *****/
+	if(hst->current_state == HOST_UP)
+		return OK;
+
 	/* check if we shouldn't renotify contacts about the host problem */
 	if(hst->no_more_notifications == TRUE) {
 		log_debug_info(DEBUGL_NOTIFICATIONS, 1, "We shouldn't re-notify contacts about this host problem.\n");

------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d




More information about the Developers mailing list