Title: [opsview-base] [325] Updated nagios_check_results_dir_sorted.patch as covered in e11c530
Revision
325
Author
tvoon
Date
2013-08-06 00:17:55 +0100 (Tue, 06 Aug 2013)

Log Message

Updated nagios_check_results_dir_sorted.patch as covered in e11c530

Modified Paths


Added Paths

Modified: trunk/Makefile
===================================================================
--- trunk/Makefile	2013-08-05 23:04:52 UTC (rev 324)
+++ trunk/Makefile	2013-08-05 23:17:55 UTC (rev 325)
@@ -546,6 +546,7 @@
 	cd ${NAGIOS} && patch -p1 < ../patches/nagios_fix_deletion_old_check_results.patch
 	# Below is merged with nagios_check_results_dir_sorted.patch
 	#cd ${NAGIOS} && patch -p1 < ../patches/nagios_kill_signal_stops_check_results.patch
+	cd ${NAGIOS} && patch -p1 < ../patches/nagios_bugfix_e11c530.patch
 	cd ${NAGIOS} && patch -p1 < ../patches/nagios_check_results_dir_sorted.patch
 	# cd ${NAGIOS} && patch -p1 < ../patches/nagios_check_result_new_filenames.patch
 	# cd ${NAGIOS} && patch -p1 < ../patches/nagios_renamed_check_results_files.patch

Added: trunk/patches/nagios_bugfix_e11c530.patch
===================================================================
--- trunk/patches/nagios_bugfix_e11c530.patch	                        (rev 0)
+++ trunk/patches/nagios_bugfix_e11c530.patch	2013-08-05 23:17:55 UTC (rev 325)
@@ -0,0 +1,27 @@
+commit e11c530198b5e29ca7236ed323f8556e21df1b11
+Author: Andreas Ericsson <a...@op5.se>
+Date:   Thu May 23 16:12:54 2013 +0200
+
+    core: Fix checkresult spool reaping
+    
+    Not that it's used anymore (except as a deprecated legacy interface
+    for passing passive checkresults to Nagios), but we really shouldn't
+    bomb out before we've even started parsing results.
+    
+    Signed-off-by: Andreas Ericsson <a...@op5.se>
+
+diff --git a/base/utils.c b/base/utils.c
+index f3a784d..625d5df 100644
+--- a/base/utils.c
++++ b/base/utils.c
+@@ -1711,8 +1711,8 @@ int process_check_result_queue(char *dirname) {
+ 			}
+ 
+ 		/* break out if we've been here too long */
+-		if ((int)(time(NULL) - start) < max_check_reaper_time) {
+-			log_debug_info(DEBUGL_CHECKS, 0, "Breaking out of check result reaper: max time exceeded\n");
++		if (start + max_check_reaper_time < time(NULL)) {
++			log_debug_info(DEBUGL_CHECKS, 0, "Breaking out of check result reaper: max time (%ds) exceeded\n", max_check_reaper_time);
+ 			break;
+ 			}
+ 

Modified: trunk/patches/nagios_check_results_dir_sorted.patch
===================================================================
--- trunk/patches/nagios_check_results_dir_sorted.patch	2013-08-05 23:04:52 UTC (rev 324)
+++ trunk/patches/nagios_check_results_dir_sorted.patch	2013-08-05 23:17:55 UTC (rev 325)
@@ -1,5 +1,6 @@
---- nagios-4.0.20130107.original/base/utils.c	2013-01-08 14:41:47.000000000 +0000
-+++ nagios-4.0.20130107/base/utils.c	2013-01-08 14:51:12.000000000 +0000
+diff -ur nagios-4.0.20130107.original//base/utils.c nagios-4.0.20130107/base/utils.c
+--- nagios-4.0.20130107.original//base/utils.c	2013-08-05 23:14:41.000000000 +0000
++++ nagios-4.0.20130107/base/utils.c	2013-08-05 23:15:25.000000000 +0000
 @@ -1973,14 +1973,15 @@
  /* processes files in the check result queue directory */
  int process_check_result_queue(char *dirname) {
@@ -43,16 +44,9 @@
  		/* bail out if we encountered a signal */
  		if (sigshutdown == TRUE || sigrestart == TRUE) {
  			log_debug_info(DEBUGL_CHECKS, 0, "Breaking out of check result reaper: signal encountered\n");
-@@ -2007,42 +2009,62 @@
+@@ -2013,36 +2015,56 @@
  			}
  
- 		/* break out if we've been here too long */
--		if ((int)(time(NULL) - start) < max_check_reaper_time) {
-+		if ((int)(time(NULL) - start) > max_check_reaper_time) {
- 			log_debug_info(DEBUGL_CHECKS, 0, "Breaking out of check result reaper: max time exceeded\n");
- 			break;
- 			}
- 
  		/* create /path/to/file */
 -		snprintf(file, sizeof(file), "%s/%s", dirname, dirfile->d_name);
 +		snprintf(file, sizeof(file), "%s/%s", dirname, dirfilelist[i]->d_name);
@@ -69,10 +63,10 @@
 +		if((x == 7 || x == 29) && dirfilelist[i]->d_name[0] == 'c') {
 +			process_file=1;
 +		}
-+
+ 
 +		free(dirfilelist[i]);
 +		i++;
- 
++
 +		if (process_file) {
  			if(stat(file, &stat_buf) == -1) {
  				logit(NSLOG_RUNTIME_WARNING, TRUE, "Warning: Could not stat() check result file '%s'.\n", file);

_______________________________________________
Opsview-checkins mailing list
Opsview-checkins@lists.opsview.org
http://lists.opsview.org/lists/listinfo/opsview-checkins

Reply via email to