Re: [Nagios-devel] Problems with escalation in nagios v2.0
Posted: Tue Jun 22, 2004 4:59 pm
This is a multi-part message in MIME format.
------=_NextPart_000_000F_01C4588B.11FC1C90
Content-Type: text/plain;
format=flowed;
charset="iso-8859-1";
reply-type=response
Content-Transfer-Encoding: 7bit
> Is anyone else having problems getting escalation working in nagios 2.0?
>
> I've created a simple config (see below) that has 2 hosts and 2 services.
> They should notify nagios1 a total of 2 times then change to nagios2 for
> the remaining notifications.
>
> The problem is that nagios2 never gets notified.
>
> http://lordsfam.net/files/minimal.cfg
Well I dug a little deeper into the code today and found that the timeperiod
checks aren't being processed correctly for escalations. The attached patch
solves the problem.
-Shad
------=_NextPart_000_000F_01C4588B.11FC1C90
Content-Type: application/octet-stream;
name="nagios-2.0-escalation_timeperiod.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="nagios-2.0-escalation_timeperiod.patch"
diff -ruN nagios-2.0a1.old/base/notifications.c =
nagios-2.0a1/base/notifications.c=0A=
--- nagios-2.0a1.old/base/notifications.c 2004-03-23 22:22:03.000000000 =
-0700=0A=
+++ nagios-2.0a1/base/notifications.c 2004-06-22 18:49:09.000000000 -0600=0A=
@@ -686,7 +686,7 @@=0A=
return FALSE;=0A=
=0A=
/* skip this escalation if it has a timeperiod and the current time =
isn't valid */=0A=
- if(se->escalation_period!=3DNULL && =
check_time_against_period(current_time,se->escalation_period)=3D=3DFALSE)=0A=
+ if(se->escalation_period!=3DNULL && =
check_time_against_period(current_time,se->escalation_period)=3D=3DERROR)=0A=
return FALSE;=0A=
=0A=
/* skip this escalation if the state options don't match */=0A=
@@ -1363,7 +1363,7 @@=0A=
return FALSE;=0A=
=0A=
/* skip this escalation if it has a timeperiod and the current time =
isn't valid */=0A=
- if(he->escalation_period!=3DNULL && =
check_time_against_period(current_time,he->escalation_period)=3D=3DFALSE)=0A=
+ if(he->escalation_period!=3DNULL && =
check_time_against_period(current_time,he->escalation_period)=3D=3DERROR)=0A=
return FALSE;=0A=
=0A=
/* skip this escalation if the state options don't match */=0A=
------=_NextPart_000_000F_01C4588B.11FC1C90--
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
------=_NextPart_000_000F_01C4588B.11FC1C90
Content-Type: text/plain;
format=flowed;
charset="iso-8859-1";
reply-type=response
Content-Transfer-Encoding: 7bit
> Is anyone else having problems getting escalation working in nagios 2.0?
>
> I've created a simple config (see below) that has 2 hosts and 2 services.
> They should notify nagios1 a total of 2 times then change to nagios2 for
> the remaining notifications.
>
> The problem is that nagios2 never gets notified.
>
> http://lordsfam.net/files/minimal.cfg
Well I dug a little deeper into the code today and found that the timeperiod
checks aren't being processed correctly for escalations. The attached patch
solves the problem.
-Shad
------=_NextPart_000_000F_01C4588B.11FC1C90
Content-Type: application/octet-stream;
name="nagios-2.0-escalation_timeperiod.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="nagios-2.0-escalation_timeperiod.patch"
diff -ruN nagios-2.0a1.old/base/notifications.c =
nagios-2.0a1/base/notifications.c=0A=
--- nagios-2.0a1.old/base/notifications.c 2004-03-23 22:22:03.000000000 =
-0700=0A=
+++ nagios-2.0a1/base/notifications.c 2004-06-22 18:49:09.000000000 -0600=0A=
@@ -686,7 +686,7 @@=0A=
return FALSE;=0A=
=0A=
/* skip this escalation if it has a timeperiod and the current time =
isn't valid */=0A=
- if(se->escalation_period!=3DNULL && =
check_time_against_period(current_time,se->escalation_period)=3D=3DFALSE)=0A=
+ if(se->escalation_period!=3DNULL && =
check_time_against_period(current_time,se->escalation_period)=3D=3DERROR)=0A=
return FALSE;=0A=
=0A=
/* skip this escalation if the state options don't match */=0A=
@@ -1363,7 +1363,7 @@=0A=
return FALSE;=0A=
=0A=
/* skip this escalation if it has a timeperiod and the current time =
isn't valid */=0A=
- if(he->escalation_period!=3DNULL && =
check_time_against_period(current_time,he->escalation_period)=3D=3DFALSE)=0A=
+ if(he->escalation_period!=3DNULL && =
check_time_against_period(current_time,he->escalation_period)=3D=3DERROR)=0A=
return FALSE;=0A=
=0A=
/* skip this escalation if the state options don't match */=0A=
------=_NextPart_000_000F_01C4588B.11FC1C90--
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]