[icinga-checkins] icinga.org: icinga-core/mfriedrich/core: core: fix NOTIFICATIONTYPE MACRO never became CUSTOM (Alexey Dvoryanchikov) #950

git at icinga.org git at icinga.org
Fri Nov 5 08:26:12 CET 2010


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

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Fri Nov  5 08:24:06 2010 +0100

core: fix NOTIFICATIONTYPE MACRO never became CUSTOM (Alexey Dvoryanchikov) #950

--SNIP--
Alexey Dvoryanchikov:

I have a bash script handler, which defines different text of
notification depending on $ICINGA_NOTIFICATIONTYPE environment
variable value, and in case of custom host or service notification
(for example, when user is requesting to send a custom host/service
notification with web interface cmd.cgi?cmd_typ=159 and
cmd.cgi?cmd_typ=160 ) it sends same text as if it was "RECOVERY"
because of wrong $NOTIFICATIONTYPE$ value.
--SNIP--

kudos to Alexey Dvoryanchikov

fixes ä950

---

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

diff --git a/Changelog b/Changelog
index 727b854..b7812b4 100644
--- a/Changelog
+++ b/Changelog
@@ -15,6 +15,7 @@ FIXES
 * core: base/nebmods: Replace local file-copy hack with my_fdcopy() (Andreas Ericsson) #424
 * core: force my_free() macro users to end the statement with a semi-colon (Andreas Ericsson) #927
 * core: fix problem with extra whitespace in command definition and ePN (Jason Young) #918
+* core: fix NOTIFICATIONTYPE MACRO never became CUSTOM (Alexey Dvoryanchikov) #950
 
 * classic ui: change servicestatus letter color to default black, not grey #946
 * classic ui: fix waste of cpu in status summary (TomTom) #933
diff --git a/base/notifications.c b/base/notifications.c
index c58c99a..b7ff300 100644
--- a/base/notifications.c
+++ b/base/notifications.c
@@ -209,6 +209,8 @@ int service_notification(service *svc, int type, char *not_author, char *not_dat
 			macro_x[MACRO_NOTIFICATIONTYPE]=(char *)strdup("DOWNTIMEEND");
 		else if(type==NOTIFICATION_DOWNTIMECANCELLED)
 			macro_x[MACRO_NOTIFICATIONTYPE]=(char *)strdup("DOWNTIMECANCELLED");
+		else if(type==NOTIFICATION_CUSTOM)
+			macro_x[MACRO_NOTIFICATIONTYPE]=(char *)strdup("CUSTOM");
 		else if(svc->current_state==STATE_OK)
 			macro_x[MACRO_NOTIFICATIONTYPE]=(char *)strdup("RECOVERY");
 		else
@@ -1314,6 +1316,8 @@ int host_notification(host *hst, int type, char *not_author, char *not_data, int
 			macro_x[MACRO_NOTIFICATIONTYPE]=(char *)strdup("DOWNTIMEEND");
 		else if(type==NOTIFICATION_DOWNTIMECANCELLED)
 			macro_x[MACRO_NOTIFICATIONTYPE]=(char *)strdup("DOWNTIMECANCELLED");
+		else if(type==NOTIFICATION_CUSTOM)
+			macro_x[MACRO_NOTIFICATIONTYPE]=(char *)strdup("CUSTOM");
 		else if(hst->current_state==HOST_UP)
 			macro_x[MACRO_NOTIFICATIONTYPE]=(char *)strdup("RECOVERY");
 		else





More information about the icinga-checkins mailing list