broken SOFT/HARD transition logic

Petya Kohts kohts at yandex-team.ru
Mon Mar 29 15:17:48 CEST 2010


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 logged AND the plugin output changed since last check, log it now.. */
        if(temp_service->state_type==HARD_STATE && state_change==FALSE && state_was_logged==FALSE && compare_strings(old_plugin_output,temp_service->plugin_output)){

-               if((temp_service->current_state==STATE_OK && temp_service->stalk_on_ok==TRUE))
+               if((temp_service->current_state==STATE_OK && temp_service->stalk_on_ok==TRUE)) {
                        log_service_event(temp_service);
+                       handle_service_event(temp_service);
+                       }

-               else if((temp_service->current_state==STATE_WARNING && temp_service->stalk_on_warning==TRUE))
+               else if((temp_service->current_state==STATE_WARNING && temp_service->stalk_on_warning==TRUE)) {
                        log_service_event(temp_service);
+                       handle_service_event(temp_service);
+                       }

-               else if((temp_service->current_state==STATE_UNKNOWN && temp_service->stalk_on_unknown==TRUE))
+               else if((temp_service->current_state==STATE_UNKNOWN && temp_service->stalk_on_unknown==TRUE)) {
                        log_service_event(temp_service);
+                       handle_service_event(temp_service);
+                       }

-               else if((temp_service->current_state==STATE_CRITICAL && temp_service->stalk_on_critical==TRUE))
+               else if((temp_service->current_state==STATE_CRITICAL && temp_service->stalk_on_critical==TRUE)) {
                        log_service_event(temp_service);
+                       handle_service_event(temp_service);
+                       }
                }

 #ifdef USE_EVENT_BROKER


Regards,
Petya.



________________________________
From: Ton Voon [mailto:ton.voon at opsera.com]
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=130

Hi Petya,

I've got this fixed already in the Opsview version of Nagios: https://secure.opsera.com/wsvn/wsvn/opsview/trunk/opsview-base/patches/nagios_host_failures_cause_incorrect_service_states.patch

However, I haven't moved this back to core Nagios because I haven't got round to adding tests for it. Can you include a test in t-tap? (Use the CVS head or the snapshot at http://nagios.sourceforge.net/download/cvs/nagios-HEAD.tar.gz)

Ton


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20100329/5b141835/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
-------------- next part --------------
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel


More information about the Developers mailing list