Page 1 of 1

Re: [Nagios-devel] custom service notifications + NOTIFICATIONTYPE

Posted: Fri Dec 03, 2010 1:30 pm
by Guest
This is a multi-part message in MIME format.
--------------090502070801080803030502
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 10/07/2010 07:17 PM, Aaron Knister wrote:
> 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. The "fix"
> seemed fairly straightforward. Here's my patch:

Your patch fixes service_notification(), but not (the almost identical
code in) host_notification(). ;-) New patch below. (Logs and
notifications.cgi are "CUSTOM aware" - anyplace else I should check?)

About the documentation: The online doc page refers to "CUSTOM" being a
valid $NOTIFICATIONTYPE$ value in the desc's of $NOTIFICATIONAUTHOR$ and
$NOTIFICATIONCOMMENT$, but it's absent from the complete list in the
desc of $NOTIFICATIONTYPE$.
http://nagios.sourceforge.net/docs/3_0/ ... cationtype

Kind regards,
J. Bern
--=20
Jochen Bern, Systemingenieur --- LINworks GmbH
Postfach 100121, 64201 Darmstadt | Robert-Koch-Str. 9, 64331 Weiterstadt
PGP (1024D/4096g) FP =3D D18B 41B1 16C0 11BA 7F8C DCF7 E1D5 FAF4 444E 1C2=
7
Tel. +49 6151 9067-231, Zentr. -0, Fax -299 - Amtsg. Darmstadt HRB 85202
Unternehmenssitz Weiterstadt, Gesch=E4ftsf=FChrer Metin Dogan, Oliver Mic=
hel

--------------090502070801080803030502
Content-Type: text/plain;
name="nagios-3.2.3-NotifTypeCustomFix-patch.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="nagios-3.2.3-NotifTypeCustomFix-patch.txt"

--- nagios-3.2.3-CVS-20101105/base/notifications.c 2010-10-28 14:31:39.000000000 +0200
+++ nagios-3.2.3+Fixes/base/notifications.c 2010-12-03 14:25:07.000000000 +0100
@@ -190,6 +190,8 @@
mac->x[MACRO_NOTIFICATIONTYPE]=(char *)strdup("DOWNTIMEEND");
else if(type==NOTIFICATION_DOWNTIMECANCELLED)
mac->x[MACRO_NOTIFICATIONTYPE]=(char *)strdup("DOWNTIMECANCELLED");
+ else if(type==NOTIFICATION_CUSTOM)
+ mac->x[MACRO_NOTIFICATIONTYPE]=(char *)strdup("CUSTOM");
else if(svc->current_state==STATE_OK)
mac->x[MACRO_NOTIFICATIONTYPE]=(char *)strdup("RECOVERY");
else
@@ -1115,6 +1117,8 @@
mac->x[MACRO_NOTIFICATIONTYPE]=(char *)strdup("DOWNTIMEEND");
else if(type==NOTIFICATION_DOWNTIMECANCELLED)
mac->x[MACRO_NOTIFICATIONTYPE]=(char *)strdup("DOWNTIMECANCELLED");
+ else if(type==NOTIFICATION_CUSTOM)
+ mac->x[MACRO_NOTIFICATIONTYPE]=(char *)strdup("CUSTOM");
else if(hst->current_state==HOST_UP)
mac->x[MACRO_NOTIFICATIONTYPE]=(char *)strdup("RECOVERY");
else

--------------090502070801080803030502--





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