Hi!

Unfortunately there was a bug in the escalation conditions.
Yes, I didn't test them enough ;-)

There will be a segfault during the processing of configuration files if
you define one escalation (with escalation conditions) for more than
one host/service using the 'time saving tricks' ([1], [2]).

There are two files attached, one for icinga 1.0.1 and another for 1.0.2.
  - escalation_conditions_patch-icinga1.0.1.patch
    This one is for icinga 1.0.1 and is tested

  - escalation_conditions_patch-icinga1.0.2.patch
    This is not tested but should work fine for 1.0.2 and 1.0.3
    since there were no changes in 1.0.3 in the xodtemplate.c

Example configurations which would cause the sigfault:

define hostescalation{
    host_name                      host1,host2,host3
    ...
}

define hostescalation{
    hostgroup_name           escalation-hosts
    ...
}

define serviceescalation{
    servicegroup_name       escalation-services
    ...
}


[1] http://docs.icinga.org/latest/en/objecttricks.html#objecttricks-hostescalation [2] http://docs.icinga.org/latest/en/objecttricks.html#objecttricks-serviceescalation

--
Regards,

Vitali Voroth
Decoit GmbH
Index: xdata/xodtemplate.c
===================================================================
--- xdata/xodtemplate.c (revision 23)
+++ xdata/xodtemplate.c (working copy)
@@ -6476,6 +6476,7 @@
                         return ERROR;
                 
                 /* string defaults */
+                new_escalationcondition->next=NULL;
                 new_escalationcondition->host_name=NULL;
                 new_escalationcondition->service_description=NULL;
                 
@@ -6499,6 +6500,7 @@
                 
new_escalationcondition->escalate_on_unknown=temp_escalationcondition->escalate_on_unknown;
                 
new_escalationcondition->escalate_on_unreachable=temp_escalationcondition->escalate_on_unreachable;
                 
new_escalationcondition->escalate_on_warning=temp_escalationcondition->escalate_on_warning;
+                
new_escalationcondition->connector=temp_escalationcondition->connector;
                 
                 /* first escalation condition is head of the condition list */
                 if(new_hostescalation->condition==NULL){
@@ -6613,6 +6615,7 @@
                         return ERROR;
  
                 /* string defaults */
+                new_escalationcondition->next=NULL;
                 new_escalationcondition->host_name=NULL;
                 new_escalationcondition->service_description=NULL;
  
@@ -6636,6 +6639,7 @@
                 
new_escalationcondition->escalate_on_unknown=temp_escalationcondition->escalate_on_unknown;
                 
new_escalationcondition->escalate_on_unreachable=temp_escalationcondition->escalate_on_unreachable;
                 
new_escalationcondition->escalate_on_warning=temp_escalationcondition->escalate_on_warning;
+                
new_escalationcondition->connector=temp_escalationcondition->connector;
                 
                 /* first escalation condition is head of the condition list */
                 if(new_serviceescalation->condition==NULL){
Index: xdata/xodtemplate.c
===================================================================
--- xdata/xodtemplate.c (revision 14)
+++ xdata/xodtemplate.c (working copy)
@@ -5479,6 +5479,7 @@
                         return ERROR;
                 
                 /* string defaults */
+                new_escalationcondition->next=NULL;
                 new_escalationcondition->host_name=NULL;
                 new_escalationcondition->service_description=NULL;
                 
@@ -5502,6 +5503,7 @@
                 
new_escalationcondition->escalate_on_unknown=temp_escalationcondition->escalate_on_unknown;
                 
new_escalationcondition->escalate_on_unreachable=temp_escalationcondition->escalate_on_unreachable;
                 
new_escalationcondition->escalate_on_warning=temp_escalationcondition->escalate_on_warning;
+                
new_escalationcondition->connector=temp_escalationcondition->connector;
                 
                 /* first escalation condition is head of the condition list */
                 if(new_hostescalation->condition==NULL){
@@ -5632,6 +5634,7 @@
                         return ERROR;
  
                 /* string defaults */
+                new_escalationcondition->next=NULL;
                 new_escalationcondition->host_name=NULL;
                 new_escalationcondition->service_description=NULL;
  
@@ -5655,6 +5658,7 @@
                 
new_escalationcondition->escalate_on_unknown=temp_escalationcondition->escalate_on_unknown;
                 
new_escalationcondition->escalate_on_unreachable=temp_escalationcondition->escalate_on_unreachable;
                 
new_escalationcondition->escalate_on_warning=temp_escalationcondition->escalate_on_warning;
+                
new_escalationcondition->connector=temp_escalationcondition->connector;
                 
                 /* first escalation condition is head of the condition list */
                 if(new_serviceescalation->condition==NULL){
------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
icinga-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/icinga-devel

Reply via email to