Title: [opsview-base] [264] Fixed CONTACTGROUPLIST macro in Nagios 4
Revision
264
Author
tvoon
Date
2013-05-28 21:36:13 +0100 (Tue, 28 May 2013)

Log Message

Fixed CONTACTGROUPLIST macro in Nagios 4

Modified Paths


Modified: trunk/patches/nagios_contactgrouplist_macro.patch
===================================================================
--- trunk/patches/nagios_contactgrouplist_macro.patch	2013-05-28 16:49:41 UTC (rev 263)
+++ trunk/patches/nagios_contactgrouplist_macro.patch	2013-05-28 20:36:13 UTC (rev 264)
@@ -1,6 +1,6 @@
-diff -Bbur nagios-4.0.20121116.orig/base/notifications.c nagios-4.0.20121116/base/notifications.c
---- nagios-4.0.20121116.orig/base/notifications.c	2012-12-03 12:08:49.000000000 +0000
-+++ nagios-4.0.20121116/base/notifications.c	2012-12-03 12:27:11.000000000 +0000
+diff -ur nagios-4.0.20130107.orig/base/notifications.c nagios-4.0.20130107/base/notifications.c
+--- nagios-4.0.20130107.orig/base/notifications.c	2013-05-23 02:11:59.000000000 +0000
++++ nagios-4.0.20130107/base/notifications.c	2013-05-23 02:12:44.000000000 +0000
 @@ -64,6 +64,10 @@
  	int increment_notification_number = FALSE;
  	nagios_macros mac;
@@ -12,7 +12,7 @@
  
  	log_debug_info(DEBUGL_FUNCTIONS, 0, "service_notification()\n");
  
-@@ -208,6 +212,23 @@
+@@ -208,6 +212,22 @@
  		/* set the notification id macro */
  		asprintf(&mac.x[MACRO_SERVICENOTIFICATIONID], "%lu", svc->current_notification_id);
  
@@ -29,14 +29,21 @@
 +				first = 0;
 +			my_free(temp_buf);
 +		}
-+		my_free(mac.x[MACRO_CONTACTGROUPLIST]);
 +		mac.x[MACRO_CONTACTGROUPLIST] = (char *)strdup(buf);
 +		my_free(buf);
 +
  		/* notify each contact (duplicates have been removed) */
  		for(temp_notification = notification_list; temp_notification != NULL; temp_notification = temp_notification->next) {
  
-@@ -1040,6 +1061,10 @@
+@@ -238,6 +258,7 @@
+ 		my_free(mac.x[MACRO_SERVICEACKAUTHORALIAS]);
+ 		my_free(mac.x[MACRO_SERVICEACKAUTHOR]);
+ 		my_free(mac.x[MACRO_SERVICEACKCOMMENT]);
++		my_free(mac.x[MACRO_CONTACTGROUPLIST]);
+ 
+ 		/* this gets set in add_notification() */
+ 		my_free(mac.x[MACRO_NOTIFICATIONRECIPIENTS]);
+@@ -1037,6 +1058,10 @@
  	int increment_notification_number = FALSE;
  	nagios_macros mac;
  	int neb_result;
@@ -47,7 +54,7 @@
  
  	/* get the current time */
  	time(&current_time);
-@@ -1175,6 +1200,23 @@
+@@ -1172,6 +1197,23 @@
  		/* set the notification id macro */
  		asprintf(&mac.x[MACRO_HOSTNOTIFICATIONID], "%lu", hst->current_notification_id);
  
@@ -71,10 +78,18 @@
  		/* notify each contact (duplicates have been removed) */
  		for(temp_notification = notification_list; temp_notification != NULL; temp_notification = temp_notification->next) {
  
-diff -Bbur nagios-4.0.20121116.orig/common/macros.c nagios-4.0.20121116/common/macros.c
---- nagios-4.0.20121116.orig/common/macros.c	2012-12-03 12:08:49.000000000 +0000
-+++ nagios-4.0.20121116/common/macros.c	2012-12-03 12:27:11.000000000 +0000
-@@ -2730,6 +2730,7 @@
+diff -ur nagios-4.0.20130107.orig/common/macros.c nagios-4.0.20130107/common/macros.c
+--- nagios-4.0.20130107.orig/common/macros.c	2012-12-24 15:29:43.000000000 +0000
++++ nagios-4.0.20130107/common/macros.c	2013-05-23 02:12:44.000000000 +0000
+@@ -1033,6 +1033,7 @@
+ 		case MACRO_NOTIFICATIONAUTHORNAME:
+ 		case MACRO_NOTIFICATIONAUTHORALIAS:
+ 		case MACRO_NOTIFICATIONCOMMENT:
++		case MACRO_CONTACTGROUPLIST:                // Opsview patch
+ 
+ 			/* notification macros have already been pre-computed */
+ 			*output = mac->x[macro_type];
+@@ -2730,6 +2731,7 @@
  	add_macrox_name(HOSTVALUE);
  	add_macrox_name(SERVICEVALUE);
  	add_macrox_name(PROBLEMVALUE);
@@ -82,9 +97,9 @@
  
  	return OK;
  	}
-diff -Bbur nagios-4.0.20121116.orig/include/macros.h nagios-4.0.20121116/include/macros.h
---- nagios-4.0.20121116.orig/include/macros.h	2012-12-03 12:08:49.000000000 +0000
-+++ nagios-4.0.20121116/include/macros.h	2012-12-03 12:27:11.000000000 +0000
+diff -ur nagios-4.0.20130107.orig/include/macros.h nagios-4.0.20130107/include/macros.h
+--- nagios-4.0.20130107.orig/include/macros.h	2012-12-24 15:29:29.000000000 +0000
++++ nagios-4.0.20130107/include/macros.h	2013-05-23 02:12:36.000000000 +0000
 @@ -38,7 +38,7 @@
  
  #define MAX_USER_MACROS				256	/* maximum number of $USERx$ macros */

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

Reply via email to