From fdc74de01faf52114578b64481c44d58abc06405 Mon Sep 17 00:00:00 2001 From: Ramesh Nachimuthu Date: Mon, 5 May 2014 16:14:50 +0530 Subject: autoconf: don't remove disconnected hosts from nagios Currently auto-config removes all the hosts with disconnected status in 'peer status' from nagios configuration. But that is not correct as a host can goto disconnected status for many differnt reasons and we should not remove the configuration. Similarly disconnected hosts need not be added to nagios configuration during auto discovery. Fixing this by ingnoring all the disconnected hosts in delta calculation. Note: Host name can't be used to identify disconnected hosts as we may not be able to communicate the disconnected host to get the host name. Hence Host UUID in peer status is used to intentify the host. Bug-Url: https://bugzilla.redhat.com/1091170 Change-Id: I3fe730d2545f8cbc8224c576712b09bb4c16e712 Signed-off-by: Ramesh Nachimuthu Reviewed-on: http://review.gluster.org/7677 Reviewed-by: Sahina Bose --- tests/test_config_generator.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/test_config_generator.py') diff --git a/tests/test_config_generator.py b/tests/test_config_generator.py index 9d6d1ab..d54ddfe 100644 --- a/tests/test_config_generator.py +++ b/tests/test_config_generator.py @@ -17,6 +17,7 @@ # from plugins import config_generator +from glusternagios.glustercli import HostStatus from testrunner import PluginsTestCase as TestCaseBase @@ -116,10 +117,14 @@ class TestGlusterNagiosConfManager(TestCaseBase): cluster = {'name': 'Test-Cluster', 'hosts': [], 'volumes': []} cluster['hosts'].append({'hostip': '10.70.43.1', 'hostname': 'host-1', + 'uuid': '0000-1111', + 'status': HostStatus.CONNECTED, 'bricks': self.createBricks(1, "Volume1", '10.70.43.1')}) cluster['hosts'].append({'hostip': '10.70.43.2', 'hostname': 'host-2', + 'status': HostStatus.CONNECTED, + 'uuid': '0000-1112', 'bricks': self.createBricks(2, "Volume1", '10.70.43.2')}) cluster['volumes'].append({'name': 'Volume1', "type": "Replicate"}) -- cgit