[omd-commits] OMD Git: omd: nagios: backported 3 patched from 3.5.1

git version control git at mathias-kettner.de
Fri Jun 7 15:39:44 CEST 2013


Module:   omd
Branch:   master
Commit:   239bc4aaf15f97400d38fc59afca5155130893e8
URL:      http://omdistro.org/projects/omd/repository/revisions/239bc4aaf15f97400d38fc59afca5155130893e8

Author:   Sven Nierlein <Sven.Nierlein at consol.de>
Date:     Fri Jun  7 15:37:58 2013 +0200
Commiter: Sven Nierlein <sven at consol.de>
Date:     Fri Jun  7 15:37:58 2013 +0200

nagios: backported 3 patched from 3.5.1

---

 .../patches/0008-fix-encoding-after-2-reloads.dif  |   10 ++++
 ...-comparison-operator-in-service-freshness-c.dif |   13 +++++
 ...-445-Adding-triggered-downtime-for-child-ho.dif |   58 ++++++++++++++++++++
 packages/nagios/patches/README                     |   16 +++++-
 4 files changed, 96 insertions(+), 1 deletion(-)

diff --git a/packages/nagios/patches/0008-fix-encoding-after-2-reloads.dif b/packages/nagios/patches/0008-fix-encoding-after-2-reloads.dif
new file mode 100644
index 0000000..45ee157
--- /dev/null
+++ b/packages/nagios/patches/0008-fix-encoding-after-2-reloads.dif
@@ -0,0 +1,10 @@
+--- nagios-3.5.0/common/macros.c.orig	2013-06-07 15:11:04.327006405 +0200
++++ nagios-3.5.0/common/macros.c	2013-06-07 15:11:23.603004838 +0200
+@@ -2585,6 +2585,7 @@
+ 	for(x = 0; x < MACRO_X_COUNT; x++) {
+ 		macro_keys[x].code = x;
+ 		macro_keys[x].name = macro_x_names[x];
++		macro_keys[x].clean_options = 0;
+ 
+ 		/* host/service output/perfdata and author/comment macros should get cleaned */
+ 		if((x >= 16 && x <= 19) || (x >= 49 && x <= 52) || (x >= 99 && x <= 100) || (x >= 124 && x <= 127)) {
diff --git a/packages/nagios/patches/0009-Corrected-comparison-operator-in-service-freshness-c.dif b/packages/nagios/patches/0009-Corrected-comparison-operator-in-service-freshness-c.dif
new file mode 100644
index 0000000..5d529f0
--- /dev/null
+++ b/packages/nagios/patches/0009-Corrected-comparison-operator-in-service-freshness-c.dif
@@ -0,0 +1,13 @@
+diff --git a/base/checks.c b/base/checks.c
+--- a/base/checks.c
++++ b/base/checks.c
+@@ -2086,7 +2086,7 @@ int is_service_result_fresh(service *temp_service, time_t current_time, int log_
+ 	 */
+ 	if(temp_service->check_type == SERVICE_CHECK_PASSIVE) {
+ 		if(temp_service->last_check < event_start &&
+-		        event_start - last_program_stop < freshness_threshold * 0.618) {
++		        event_start - last_program_stop > freshness_threshold * 0.618) {
+ 			expiration_time = event_start + freshness_threshold;
+ 			}
+ 		}
+
diff --git a/packages/nagios/patches/0010-Fixed-bug-445-Adding-triggered-downtime-for-child-ho.dif b/packages/nagios/patches/0010-Fixed-bug-445-Adding-triggered-downtime-for-child-ho.dif
new file mode 100644
index 0000000..1f683f4
--- /dev/null
+++ b/packages/nagios/patches/0010-Fixed-bug-445-Adding-triggered-downtime-for-child-ho.dif
@@ -0,0 +1,58 @@
+diff --git a/common/downtime.c b/common/downtime.c
+--- a/common/downtime.c
++++ b/common/downtime.c
+@@ -360,6 +360,14 @@ int register_downtime(int type, unsigned long downtime_id) {
+ 			}
+ 		}
+ 
++	/* If the downtime is triggered and was in effect, mark it as not in 
++		effect so it gets scheduled correctly */
++	if((temp_downtime->triggered_by != 0) && 
++			(TRUE == temp_downtime->is_in_effect)) {
++		was_in_effect = temp_downtime->is_in_effect;
++		temp_downtime->is_in_effect = FALSE;
++		}
++
+ 	if((FALSE == temp_downtime->fixed) && (FALSE == was_in_effect)) {
+ 		/* increment pending flex downtime counter */
+ 		if(temp_downtime->type == HOST_DOWNTIME)
+@@ -1111,6 +1119,39 @@ int add_downtime(int downtime_type, char *host_name, char *svc_description, time
+ static int downtime_compar(const void *p1, const void *p2) {
+ 	scheduled_downtime *d1 = *(scheduled_downtime **)p1;
+ 	scheduled_downtime *d2 = *(scheduled_downtime **)p2;
++
++	/*
++ 		If the start times of two downtimes are equal and one is triggered but
++		but the other is not, the triggered downtime should be later in the
++		list than the untriggered one. This is so they are written to the
++		retention.dat and status.dat in the correct order.
++
++		Previously the triggered downtime always appeared before its 
++		triggering downtime in those files. When the downtimes were read 
++		from those files, either on a core restart or by the CGIs, the 
++		triggered downtime would be discarded because the triggering 
++		downtime did not yet exist.
++
++		The most common case for this is when a downtime is created and 
++		the option is selected to create triggered downtimes on all child 
++		objects. This change in the sort order does NOT resolve the 
++		case where a manually created, triggered downtime is created with 
++		a start time earlier than the triggering downtime.
++
++		This would need to be resolved by comparing the triggered_by value
++		with the downtime ID regardless of the start time. However, this
++		should be a relatively rare case and only caused by intentional
++		scheduling by a human. This change was not implemented because it
++		would cause the downtime list to be out of time order and the
++		implications of this were not well understood.
++	*/
++
++	if(d1->start_time == d2->start_time) {
++		if(( d1->triggered_by == 0 && d2->triggered_by != 0) ||
++				( d1->triggered_by != 0 && d2->triggered_by == 0)) {
++			return d1->triggered_by == 0 ? -1 : 1;
++			}
++		}
+ 	return (d1->start_time < d2->start_time) ? -1 : (d1->start_time - d2->start_time);
+ 	}
+ 
diff --git a/packages/nagios/patches/README b/packages/nagios/patches/README
index b361865..729521d 100644
--- a/packages/nagios/patches/README
+++ b/packages/nagios/patches/README
@@ -35,5 +35,19 @@ Index of patches
     whenever you press F5.
 
 0007:
-   This patch rearranges the fields in the nagios struct schedule_downtime 
+   This patch rearranges the fields in the nagios struct schedule_downtime
    to be compatible again with the one livestatus is compiled with
+
+0008:
+   Reloading nagios config causes spaces in notifications to become
+   plus signs
+   http://sourceforge.net/p/nagios/nagioscore/ci/23c59c2b2725ec20934aee6f0b03ba464b708ec1/
+
+0009:
+  Corrected comparison operator in service freshness check logic
+  http://sourceforge.net/p/nagios/nagioscore/ci/6a6bf5320c0d81e60a77478809885d4fd7c362e4/
+
+0010:
+  Adding triggered downtime for child hosts causes a SIGSEGV on
+  restart/reload
+  http://sourceforge.net/p/nagios/nagioscore/ci/76310176f3ec9a37b0b4161dddbbea69b6fa6a73/



More information about the omd-commits mailing list