This is a multi-part message in MIME format.
--------------000306010304090104020200
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
I've now done testing on the new directives, they behave as I expect.
I've tested against a patched 3.0.6 with no modifications to original
config files and they retain their original behavior as well. This new
patch contains updates to the html documentation (which for some reason
doesn't patch cleanly against 3.0.6. patches to code still patches
clean) as well.
I haven't heard anything from the devs since the last time I posted. If
this is in a queue somewhere slated to be looked at that's fine, I just
want to make sure that there isn't something I should fix up to make the
patch eligible for integration.
-Gius
--------------000306010304090104020200
Content-Type: text/x-patch;
name="nagios.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="nagios.patch"
diff -ur nagiosclean/base/checks.c nagiospatched/base/checks.c
--- nagiosclean/base/checks.c 2009-08-11 09:56:39.000000000 -0700
+++ nagiospatched/base/checks.c 2009-11-19 17:13:07.000000000 -0800
@@ -1294,6 +1294,9 @@
temp_service->last_notification=(time_t)0;
temp_service->next_notification=(time_t)0;
temp_service->current_notification_number=0;
+ temp_service->current_warning_notification_number=0;
+ temp_service->current_critical_notification_number=0;
+ temp_service->current_unknown_notification_number=0;
temp_service->problem_has_been_acknowledged=FALSE;
temp_service->acknowledgement_type=ACKNOWLEDGEMENT_NONE;
temp_service->notified_on_unknown=FALSE;
diff -ur nagiosclean/base/notifications.c nagiospatched/base/notifications.c
--- nagiosclean/base/notifications.c 2008-11-30 09:22:58.000000000 -0800
+++ nagiospatched/base/notifications.c 2009-12-13 16:12:02.000000000 -0800
@@ -98,10 +98,23 @@
/* should the notification number be increased? */
if(type==NOTIFICATION_NORMAL || (options & NOTIFICATION_OPTION_INCREMENT)){
svc->current_notification_number++;
+ /* also increment the warning/critical/unknown state counter */
+ if (svc->current_state == STATE_WARNING) {
+ svc->current_warning_notification_number++;
+ }
+ if (svc->current_state == STATE_CRITICAL) {
+ svc->current_critical_notification_number++;
+ }
+ if (svc->current_state == STATE_UNKNOWN) {
+ svc->current_unknown_notification_number++;
+ }
increment_notification_number=TRUE;
}
log_debug_info(DEBUGL_NOTIFICATIONS,1,"Current notification number: %d (%s)\n",svc->current_notification_number,(increment_notification_number==TRUE)?"incremented":"unchanged");
+ log_debug_info(DEBUGL_NOTIFICATIONS,1,"Current warning notification number: %d (%s)\n",svc->current_warning_notification_number,(increment_notification_number==TRUE)?"incremented":"unchanged");
+ log_debug_info(DEBUGL_NOTIFICATIONS,1,"Current critical notification number: %d (%s)\n",svc->current_critical_notification_number,(increment_notification_number==TRUE)?"incremented":"unchanged");
+ log_debug_info(DEBUGL_NOTIFICATIONS,1,"Current unknown notification number: %d (%s)\n",svc->current_unknown_notification_number,(increment_notification_number==TRUE)?"incremented":"unchanged");
/* save and increase the current notification id */
svc->current_notification_id=next_notification_id;
@@ -256,6 +269,15 @@
/* adjust current notification number */
svc->current_notification_number--;
+ if (svc->current_state == STATE_WARNING) {
+ svc->current_warning_notification_number--;
+ }
+ if (svc->current_state == STATE_CRITICAL) {
+ svc->current_critical_notification_number--;
+ }
+ if (svc->current_state == STATE_UNKNOWN) {
+ svc->current_unknown_notification_number--;
+ }
log_debug_info(DEBUGL_NOTIFICATIONS,0,"No contacts were notified. Next possible notification time: %s",ctime(&svc->next_notification));
}
@@ -269,8 +291,18 @@
else{
/* readjust current notification number, since one didn't go out */
- if(increment_notification_number==TRUE)
+ if(increment_notification_number==TRUE) {
svc->current_notification_
...[email truncated]...
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]