--- nagios-3.2.3+SmallPatches/sample-config/cgi.cfg.orig	2010-11-05 20:30:26.000000000 +0100
+++ nagios-3.2.3+SmallPatches/sample-config/cgi.cfg.in	2010-11-05 21:52:15.000000000 +0100
@@ -370,3 +370,31 @@
 #tab_friendly_titles=1
 
 
+
+
+# SERVICE STATES TO ANNOTATE WITH CURRENT NOTIFICATION NO.
+# Set this to an OR of the service state identifiers for
+# which status.cgi should not only report "Attempts" (e.g.,
+# "3/3" for a HARD non-OK state with max_check_attempts=3)
+# but also the current notification number ("(#0)" if no
+# problem notification has been sent yet, etc.). This is
+# helpful to identify services which switched between
+# different non-OK states a lot, or services which have a
+# first_notification_delay set and are "not yet officially"
+# considered in trouble.
+# Relevant values from include/statusdata.h (look them up
+# *there* if you want to be *really* sure):
+#	#define	SERVICE_PENDING		1
+#	#define	SERVICE_OK		2
+#	#define	SERVICE_WARNING		4
+#	#define	SERVICE_UNKNOWN		8
+#	#define	SERVICE_CRITICAL	16
+# You'll likely want to use add_notif_num_hard=0 (default)
+# or add_notif_num_hard=28 (warn+crit+unknown). There's an
+# add_notif_num_soft affecting services in a SOFT state
+# for sake of completeness, too.
+
+#add_notif_num_hard=28
+#add_notif_num_soft=0
+
+
--- nagios-3.2.3+SmallPatches/cgi/cgiutils.orig	2010-11-05 20:16:50.000000000 +0100
+++ nagios-3.2.3+SmallPatches/cgi/cgiutils.c	2010-11-05 21:47:02.000000000 +0100
@@ -119,6 +119,8 @@
 int		color_transparency_index_b=255;
 
 int		tab_friendly_titles=FALSE;
+int		add_notif_num_hard=0;
+int		add_notif_num_soft=0;
 
 extern hostgroup       *hostgroup_list;
 extern contactgroup    *contactgroup_list;
@@ -436,6 +438,12 @@
 
 		else if(!strcmp(var,"tab_friendly_titles"))
 			tab_friendly_titles=(atoi(val)>0)?TRUE:FALSE;
+
+		else if(!strcmp(var,"add_notif_num_hard"))
+			add_notif_num_hard=atoi(val);
+
+		else if(!strcmp(var,"add_notif_num_soft"))
+			add_notif_num_soft=atoi(val);
  	        }
 
 	/* free memory and close the file */
--- nagios-3.2.3+SmallPatches/cgi/status.orig	2010-11-05 20:26:48.000000000 +0100
+++ nagios-3.2.3+SmallPatches/cgi/status.c	2010-11-05 21:55:21.000000000 +0100
@@ -59,6 +59,8 @@
 extern int enable_splunk_integration;
 
 extern int tab_friendly_titles;
+extern int add_notif_num_hard;
+extern int add_notif_num_soft;
 
 extern host *host_list;
 extern service *service_list;
@@ -1792,7 +1794,10 @@
 			printf("<TD CLASS='status%s'>%s</TD>\n",status_class,status);
 			printf("<TD CLASS='status%s' nowrap>%s</TD>\n",status_bg_class,date_time);
 			printf("<TD CLASS='status%s' nowrap>%s</TD>\n",status_bg_class,state_duration);
-			printf("<TD CLASS='status%s'>%d/%d</TD>\n",status_bg_class,temp_status->current_attempt,temp_status->max_attempts);
+			printf("<TD CLASS='status%s'>%d/%d %s#%d%s</TD>\n",status_bg_class,temp_status->current_attempt,temp_status->max_attempts,
+				(temp_status->status&(temp_status->state_type==HARD_STATE?add_notif_num_hard:add_notif_num_soft)?"(":"<!-- "),
+				temp_status->current_notification_number,
+				(temp_status->status&(temp_status->state_type==HARD_STATE?add_notif_num_hard:add_notif_num_soft)?")":" -->"));
 			printf("<TD CLASS='status%s' valign='center'>",status_bg_class);
 			printf("%s&nbsp;",(temp_status->plugin_output==NULL)?"":html_encode(temp_status->plugin_output,TRUE));
 			/*