[Nagios-devel] Flapping not showing on notification summary

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] Flapping not showing on notification summary

Post by Guest »

This is a multi-part message in MIME format.

------=_NextPart_000_0064_01C47BB4.F9B58890
Content-Type: text/plain;
format=flowed;
charset="iso-8859-1";
reply-type=original
Content-Transfer-Encoding: 7bit

When viewing the notification history all notifications that are for
flappingstart or flappingstop show up as unknown. The attached patch
defines flapping start and flapping stop as their own notification types.
The only part about this patch that I don't like is that the class is left
at unknown.

-Shad

------=_NextPart_000_0064_01C47BB4.F9B58890
Content-Type: application/octet-stream;
name="nagios-2.0-notification-cgi.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="nagios-2.0-notification-cgi.patch"

diff -ruN nagios-2.0a1.old/cgi/notifications.c =
nagios-2.0a1/cgi/notifications.c=0A=
--- nagios-2.0a1.old/cgi/notifications.c 2003-08-14 19:34:09.000000000 =
-0600=0A=
+++ nagios-2.0a1/cgi/notifications.c 2004-08-06 12:48:18.000000000 -0600=0A=
@@ -236,11 +236,13 @@=0A=
printf("Service =
unknown\n",NOTIFICATION_SERVICE_UNKNOWN,(notification_options=3D=3DNOTIFI=
CATION_SERVICE_UNKNOWN)?"selected":"");=0A=
printf("Service =
critical\n",NOTIFICATION_SERVICE_CRITICAL,(notification_options=3D=3DNOTI=
FICATION_SERVICE_CRITICAL)?"selected":"");=0A=
printf("Service =
recovery\n",NOTIFICATION_SERVICE_RECOVERY,(notification_options=3D=3DNOTI=
FICATION_SERVICE_RECOVERY)?"selected":"");=0A=
+ printf("Service =
flapping\n",NOTIFICATION_SERVICE_FLAP,(notification_options=3D=3DNOTIFICA=
TION_SERVICE_FLAP)?"selected":"");=0A=
if(query_type!=3DFIND_SERVICE){=0A=
printf("Host =
acknowledgements\n",NOTIFICATION_HOST_ACK,(notification_options=3D=3DNOTI=
FICATION_HOST_ACK)?"selected":"");=0A=
printf("Host =
down\n",NOTIFICATION_HOST_DOWN,(notification_options=3D=3DNOTIFICATION_HO=
ST_DOWN)?"selected":"");=0A=
printf("Host =
unreachable\n",NOTIFICATION_HOST_UNREACHABLE,(notification_options=3D=3DN=
OTIFICATION_HOST_UNREACHABLE)?"selected":"");=0A=
printf("Host =
recovery\n",NOTIFICATION_HOST_RECOVERY,(notification_options=3D=3DNOTIFIC=
ATION_HOST_RECOVERY)?"selected":"");=0A=
+ printf("Host =
flapping\n",NOTIFICATION_HOST_FLAP,(notification_options=3D=3DNOTIFICATIO=
N_HOST_FLAP)?"selected":"");=0A=
}=0A=
printf("\n");=0A=
printf("\n");=0A=
@@ -580,6 +582,16 @@=0A=
notification_detail_type=3DNOTIFICATION_SERVICE_ACK;=0A=
strcpy(alert_level_class,"ACKNOWLEDGEMENT");=0A=
}=0A=
+ else if(strstr(alert_level,"FLAPPINGSTART (")){=0A=
+ strcpy(alert_level,"FLAPPING START");=0A=
+ notification_detail_type=3DNOTIFICATION_SERVICE_FLAP;=0A=
+ strcpy(alert_level_class,"UNKNOWN");=0A=
+ }=0A=
+ else if(strstr(alert_level,"FLAPPINGSTOP (")){=0A=
+ strcpy(alert_level,"FLAPPING STOP");=0A=
+ notification_detail_type=3DNOTIFICATION_SERVICE_FLAP;=0A=
+ strcpy(alert_level_class,"UNKNOWN");=0A=
+ }=0A=
else{=0A=
strcpy(alert_level,"UNKNOWN");=0A=
notification_detail_type=3DNOTIFICATION_SERVICE_UNKNOWN;=0A=
@@ -608,6 +620,16 @@=0A=
strcpy(alert_level_class,"HOSTACKNOWLEDGEMENT");=0A=
notification_detail_type=3DNOTIFICATION_HOST_ACK;=0A=
}=0A=
+ else if(strstr(alert_level,"FLAPPINGSTART (")){=0A=
+ strcpy(alert_level,"FLAPPING START");=0A=
+ strcpy(alert_level_class,"UNKNOWN");=0A=
+ notification_detail_type=3DNOTIFICATION_HOST_FLAP;=0A=
+ }=0A=
+ else if(strstr(alert_level,"FLAPPINGSTOP (")){=0A=
+ strcpy(alert_level,"FLAPPING STOP");=0A=
+ strcpy(alert_level_class,"UNKNOWN");=0A=
+ notification_detail_type=3DNOTIFICATION_HOST_FLAP;=0A=
+ }=0A=
}=0A=
=0A=
/* get the method name */=0A=
diff -ruN nagios-2.0a1.old/include/cgiutils.h.in =
nagios-2.0a1/include/cgiutils.h.in=0A=
--- nagios-2.0a1.old/include/cgiutils.h.in 2004-02-09 21:18:27.000000000 =
-0700=0A=
+++ nagios-2.0a1/include/cgiutils.h.in 200

...[email truncated]...


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