[Pkg-nagios-changes] [SCM] UNNAMED PROJECT branch, debian/master, updated. 810edbdd3feedbfe37f4a65bee50b57b2f60fa2a

Naparuba naparuba at gmail.com
Tue Feb 28 22:21:29 UTC 2012


The following commit has been merged in the debian/master branch:
commit a224f649cd6575f905d35ad056feb37f7de59127
Author: Naparuba <naparuba at gmail.com>
Date:   Fri Feb 17 08:45:21 2012 +0100

    Fix : property class/instance name overwrite for flapping things.

diff --git a/shinken/objects/config.py b/shinken/objects/config.py
index e5f94ac..5a4bfb7 100644
--- a/shinken/objects/config.py
+++ b/shinken/objects/config.py
@@ -170,10 +170,10 @@ class Config(Item):
         'child_processes_fork_twice': UnusedProp(text='fork twice is not use.'),
         'enable_environment_macros': BoolProp(default='1', class_inherit=[(Host, None), (Service, None)]),
         'enable_flap_detection':    BoolProp(default='1', class_inherit=[(Host, None), (Service, None)]),
-        'low_service_flap_threshold': IntegerProp(default='20', class_inherit=[(Service, 'low_flap_threshold')]),
-        'high_service_flap_threshold': IntegerProp(default='30', class_inherit=[(Service, 'high_flap_threshold')]),
-        'low_host_flap_threshold':  IntegerProp(default='20', class_inherit=[(Host, 'low_flap_threshold')]),
-        'high_host_flap_threshold': IntegerProp(default='30', class_inherit=[(Host, 'high_flap_threshold')]),
+        'low_service_flap_threshold': IntegerProp(default='20', class_inherit=[(Service, 'global_low_flap_threshold')]),
+        'high_service_flap_threshold': IntegerProp(default='30', class_inherit=[(Service, 'global_high_flap_threshold')]),
+        'low_host_flap_threshold':  IntegerProp(default='20', class_inherit=[(Host, 'global_low_flap_threshold')]),
+        'high_host_flap_threshold': IntegerProp(default='30', class_inherit=[(Host, 'global_high_flap_threshold')]),
         'soft_state_dependencies':  BoolProp(managed=False, default='0'),
         'service_check_timeout':    IntegerProp(default='60', class_inherit=[(Service, 'check_timeout')]),
         'host_check_timeout':       IntegerProp(default='30', class_inherit=[(Host, 'check_timeout')]),
diff --git a/shinken/objects/schedulingitem.py b/shinken/objects/schedulingitem.py
index 40202ac..35f7215 100644
--- a/shinken/objects/schedulingitem.py
+++ b/shinken/objects/schedulingitem.py
@@ -137,10 +137,10 @@ class SchedulingItem(Item):
         (low_flap_threshold, high_flap_threshold) = (self.low_flap_threshold, self.high_flap_threshold)
         if low_flap_threshold == -1:
             cls = self.__class__
-            low_flap_threshold = cls.low_flap_threshold
+            low_flap_threshold = cls.global_low_flap_threshold
         if high_flap_threshold  == -1:
             cls = self.__class__
-            high_flap_threshold = cls.high_flap_threshold
+            high_flap_threshold = cls.global_high_flap_threshold
 
         # Now we check is flapping change, but only if we got enouth
         # states to llok at the value accurancy
diff --git a/test/test_flapping.py b/test/test_flapping.py
index 8402456..8f5ad7c 100755
--- a/test/test_flapping.py
+++ b/test/test_flapping.py
@@ -49,6 +49,9 @@ class TestFlapping(ShinkenTest):
         self.assert_(host.state_type == 'HARD')
         self.assert_(svc.flap_detection_enabled)
 
+        print 'A'*41, svc.low_flap_threshold
+        self.assert_(svc.low_flap_threshold == -1)
+
         # Now 1 test with a bad state
         self.scheduler_loop(1, [[svc, 2, 'Crit']])
         print "******* Current flap change lsit", svc.flapping_changes

-- 
UNNAMED PROJECT



More information about the Pkg-nagios-changes mailing list