Re: [Nagios-devel] broken SOFT/HARD transition logic
Posted: Mon Mar 29, 2010 12:36 pm
--_000_81B49723DDE3EF45917AD7E899CDFD7301D0E055681AFINEldyande_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Hello, Ton.
Sorry for the delay, I've been quite busy lately.
I've looked through t-tap/* and found
no suitable test which could be used
to test the described situation.
Do you think this test should be new *.c file?
Do you expect full test (running event_execution_loop)
or just test for the function?
Since we're discussing the case do you think
it is possible to include the following patch
into main nagios (the same function):
--- checks.c.2 2010-03-05 15:54:53.000000000 +0300
+++ checks.c 2010-03-29 17:16:03.000000000 +0400
@@ -1583,17 +1583,25 @@
/* if we're stalking this state type and state was not already logg=
ed AND the plugin output changed since last check, log it now.. */
if(temp_service->state_type=3D=3DHARD_STATE && state_change=3D=3DFA=
LSE && state_was_logged=3D=3DFALSE && compare_strings(old_plugin_output,tem=
p_service->plugin_output)){
- if((temp_service->current_state=3D=3DSTATE_OK && temp_servi=
ce->stalk_on_ok=3D=3DTRUE))
+ if((temp_service->current_state=3D=3DSTATE_OK && temp_servi=
ce->stalk_on_ok=3D=3DTRUE)) {
log_service_event(temp_service);
+ handle_service_event(temp_service);
+ }
- else if((temp_service->current_state=3D=3DSTATE_WARNING && =
temp_service->stalk_on_warning=3D=3DTRUE))
+ else if((temp_service->current_state=3D=3DSTATE_WARNING && =
temp_service->stalk_on_warning=3D=3DTRUE)) {
log_service_event(temp_service);
+ handle_service_event(temp_service);
+ }
- else if((temp_service->current_state=3D=3DSTATE_UNKNOWN && =
temp_service->stalk_on_unknown=3D=3DTRUE))
+ else if((temp_service->current_state=3D=3DSTATE_UNKNOWN && =
temp_service->stalk_on_unknown=3D=3DTRUE)) {
log_service_event(temp_service);
+ handle_service_event(temp_service);
+ }
- else if((temp_service->current_state=3D=3DSTATE_CRITICAL &&=
temp_service->stalk_on_critical=3D=3DTRUE))
+ else if((temp_service->current_state=3D=3DSTATE_CRITICAL &&=
temp_service->stalk_on_critical=3D=3DTRUE)) {
log_service_event(temp_service);
+ handle_service_event(temp_service);
+ }
}
#ifdef USE_EVENT_BROKER
Regards,
Petya.
________________________________
From: Ton Voon [mailto:[email protected]]
Sent: Monday, March 08, 2010 4:13 PM
To: Nagios Developers List
Subject: Re: [Nagios-devel] broken SOFT/HARD transition logic
On 5 Mar 2010, at 13:42, Petya Kohts wrote:
Sorry for spamming, previos ticket and patch were a mess,
now the real problem with correct patch is here:
http://tracker.nagios.org/view.php?id=3D130
Hi Petya,
I've got this fixed already in the Opsview version of Nagios: https://secur=
e.opsera.com/wsvn/wsvn/opsview/trunk/opsview-base/patches/nagios_host_failu=
res_cause_incorrect_service_states.patch
However, I haven't moved this back to core Nagios because I haven't got rou=
nd to adding tests for it. Can you include a test in t-tap? (Use the CVS he=
ad or the snapshot at http://nagios.sourceforge.net/download/cvs/nagios-HEA=
D.tar.gz)
Ton
--_000_81B49723DDE3EF45917AD7E899CDFD7301D0E055681AFINEldyande_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Hello, Ton.
...[email truncated]...
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: on Voon [mailto:[email protected]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Hello, Ton.
Sorry for the delay, I've been quite busy lately.
I've looked through t-tap/* and found
no suitable test which could be used
to test the described situation.
Do you think this test should be new *.c file?
Do you expect full test (running event_execution_loop)
or just test for the function?
Since we're discussing the case do you think
it is possible to include the following patch
into main nagios (the same function):
--- checks.c.2 2010-03-05 15:54:53.000000000 +0300
+++ checks.c 2010-03-29 17:16:03.000000000 +0400
@@ -1583,17 +1583,25 @@
/* if we're stalking this state type and state was not already logg=
ed AND the plugin output changed since last check, log it now.. */
if(temp_service->state_type=3D=3DHARD_STATE && state_change=3D=3DFA=
LSE && state_was_logged=3D=3DFALSE && compare_strings(old_plugin_output,tem=
p_service->plugin_output)){
- if((temp_service->current_state=3D=3DSTATE_OK && temp_servi=
ce->stalk_on_ok=3D=3DTRUE))
+ if((temp_service->current_state=3D=3DSTATE_OK && temp_servi=
ce->stalk_on_ok=3D=3DTRUE)) {
log_service_event(temp_service);
+ handle_service_event(temp_service);
+ }
- else if((temp_service->current_state=3D=3DSTATE_WARNING && =
temp_service->stalk_on_warning=3D=3DTRUE))
+ else if((temp_service->current_state=3D=3DSTATE_WARNING && =
temp_service->stalk_on_warning=3D=3DTRUE)) {
log_service_event(temp_service);
+ handle_service_event(temp_service);
+ }
- else if((temp_service->current_state=3D=3DSTATE_UNKNOWN && =
temp_service->stalk_on_unknown=3D=3DTRUE))
+ else if((temp_service->current_state=3D=3DSTATE_UNKNOWN && =
temp_service->stalk_on_unknown=3D=3DTRUE)) {
log_service_event(temp_service);
+ handle_service_event(temp_service);
+ }
- else if((temp_service->current_state=3D=3DSTATE_CRITICAL &&=
temp_service->stalk_on_critical=3D=3DTRUE))
+ else if((temp_service->current_state=3D=3DSTATE_CRITICAL &&=
temp_service->stalk_on_critical=3D=3DTRUE)) {
log_service_event(temp_service);
+ handle_service_event(temp_service);
+ }
}
#ifdef USE_EVENT_BROKER
Regards,
Petya.
________________________________
From: Ton Voon [mailto:[email protected]]
Sent: Monday, March 08, 2010 4:13 PM
To: Nagios Developers List
Subject: Re: [Nagios-devel] broken SOFT/HARD transition logic
On 5 Mar 2010, at 13:42, Petya Kohts wrote:
Sorry for spamming, previos ticket and patch were a mess,
now the real problem with correct patch is here:
http://tracker.nagios.org/view.php?id=3D130
Hi Petya,
I've got this fixed already in the Opsview version of Nagios: https://secur=
e.opsera.com/wsvn/wsvn/opsview/trunk/opsview-base/patches/nagios_host_failu=
res_cause_incorrect_service_states.patch
However, I haven't moved this back to core Nagios because I haven't got rou=
nd to adding tests for it. Can you include a test in t-tap? (Use the CVS he=
ad or the snapshot at http://nagios.sourceforge.net/download/cvs/nagios-HEA=
D.tar.gz)
Ton
--_000_81B49723DDE3EF45917AD7E899CDFD7301D0E055681AFINEldyande_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Hello, Ton.
...[email truncated]...
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: on Voon [mailto:[email protected]