Page 1 of 1

[Nagios-devel] custom service notifications + NOTIFICATIONTYPE macro

Posted: Thu Oct 07, 2010 4:17 pm
by Guest
Hi,

I'm using the custom service notification features of nagios 3 from my
event handler scripts. I noticed that custom service notifications
were being sent out with NOTIFICATIONTYPE set to recovery instead of
custom as the documentation indicates should be the case.=A0 The "fix"
seemed fairly straightforward. Here's my patch:

diff -ur nagios-3.2.3/base/notifications.c nagios-3.2.3-new/base/notificati=
ons.c
--- nagios-3.2.3/base/notifications.c 2010-08-04 22:43:53.000000000 -0400
+++ nagios-3.2.3-new/base/notifications.c 2010-10-07 12:59:23.000000000 -04=
00
@@ -190,6 +190,8 @@
macro_x[MACRO_NOTIFICATIONTYPE]=3D(char *)strdup("DOWNTIMEEND");
else if(type=3D=3DNOTIFICATION_DOWNTIMECANCELLED)
macro_x[MACRO_NOTIFICATIONTYPE]=3D(char *)strdup("DOWNTIMECANCELLED");
+ else if(type=3D=3DNOTIFICATION_CUSTOM)
+ macro_x[MACRO_NOTIFICATIONTYPE]=3D(char *)strdup("CUSTOM");
else if(svc->current_state=3D=3DSTATE_OK)
macro_x[MACRO_NOTIFICATIONTYPE]=3D(char *)strdup("RECOVERY");
else


If anyone sees issues with it, please let me know.

-Aaron





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]