[Nagios-devel] Suggestion to first_notification_delay

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] Suggestion to first_notification_delay

Post by Guest »

--00151747b9fca436dd04abfb078d
Content-Type: text/plain; charset=ISO-8859-1

I have tested those modifications on Nagios 3.2.3 source and I think it
works better than the original code. The patch keeps the first notification
greater then the last state change, whenever the state changes happens.

Rogerio Cunha.

--- base/notifications.c 2010-08-04 23:43:53.000000000 -0300
+++ base2/notifications.c.4 2011-09-02 16:53:40.139155621 -0300
@@ -504,13 +504,9 @@

/* determine the time to use of the first problem point */
first_problem_time=svc->last_time_ok; /* not accurate, but its the
earliest time we could use in the comparison */
- if((svc->last_time_warning last_time_warning > svc->last_time_ok))
- first_problem_time=svc->last_time_warning;
- if((svc->last_time_unknown last_time_unknown > svc->last_time_ok))
- first_problem_time=svc->last_time_unknown;
- if((svc->last_time_critical last_time_critical > svc->last_time_ok))
- first_problem_time=svc->last_time_critical;
-
+ if((svc->last_hard_state_change > svc->last_time_ok)) {
+ first_problem_time=svc->last_hard_state_change;
+ }
if(current_time first_notification_delay*interval_length))){
log_debug_info(DEBUGL_NOTIFICATIONS,1,"Not enough time has
elapsed since the service changed to a non-OK state, so we should not notify
about this problem yet\n");
return ERROR;
@@ -1393,11 +1389,8 @@

/* determine the time to use of the first problem point */
first_problem_time=hst->last_time_up; /* not accurate, but its the
earliest time we could use in the comparison */
- if((hst->last_time_down last_time_down > hst->last_time_up))
- first_problem_time=hst->last_time_down;
- if((hst->last_time_unreachable last_time_unreachable > hst->last_time_unreachable))
- first_problem_time=hst->last_time_unreachable;
-
+ if((hst->last_hard_state_change > first_problem_time))
+ first_problem_time=hst->last_hard_state_change;
if(current_time first_notification_delay*interval_length))){
log_debug_info(DEBUGL_NOTIFICATIONS,1,"Not enough time has
elapsed since the host changed to a non-UP state (or since program start),
so we shouldn't notify about this problem yet.\n");
return ERROR;

--00151747b9fca436dd04abfb078d
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

I have tested those modifications on Nagios 3.2.3 source and I think it wor=
ks better than the original code. The patch keeps the first notification gr=
eater then the last=A0 state change, whenever the state changes happens.

Rogerio Cunha.--- base/notifications.c=A0=A0=A0 2010-08-04 23:4=
3:53.000000000 -0300+++ base2/notifications.c.4=A0=A0=A0 2011-09-02 16:=
53:40.139155621 -0300@@ -504,13 +504,9 @@=A0=A0=A0=A0=A0 =A0=A0=
=A0 /* determine the time to use of the first problem point */

=A0=A0=A0=A0 =A0=A0=A0 first_problem_time=3Dsvc->last_time_ok; /* not ac=
curate, but its the earliest time we could use in the comparison */-=A0=
=A0=A0 =A0=A0=A0 if((svc->last_time_warning < first_problem_time) &am=
p;& (svc->last_time_warning > svc->last_time_ok))

-=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 first_problem_time=3Dsvc->last_time_warni=
ng;-=A0=A0=A0 =A0=A0=A0 if((svc->last_time_unknown < first_proble=
m_time) && (svc->last_time_unknown > svc->last_time_ok))-=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 first_problem_time=3Dsvc->last_time_unk=
nown;

-=A0=A0=A0 =A0=A0=A0 if((svc->last_time_critical < first_problem_time=
) && (svc->last_time_critical > svc->last_time_ok))-=
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 first_problem_time=3Dsvc->last_ti

...[email truncated]...


This post was automatically imported from historical nagios-devel mailing list archives
Original poster: rogerio.cunha@gmail.com
Locked