summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSahina Bose <sabose@redhat.com>2014-05-05 12:00:51 +0530
committerSahina Bose <sabose@redhat.com>2014-05-05 02:39:12 -0700
commit5ddf85983a330da73f6a1b9b5dac10b768e19261 (patch)
tree784070e8a04f2deec80fb4a411812e86ce34d309
parent33f927b5ff56f4b00635234de75b8ae57cb56214 (diff)
nagios-server: Added quorum service to auto config
Added a quorum service to auto-config generator. Renamed "Volume Status Quota" to "Volume Quota" service Change-Id: Id83eefeee63bf7c34373196f4cfa2b326e1cb71d Signed-off-by: Sahina Bose <sabose@redhat.com> Reviewed-on: http://review.gluster.org/7661 Reviewed-by: Kanagaraj M <kmayilsa@redhat.com> Reviewed-by: Ramesh N <rnachimu@redhat.com>
-rw-r--r--plugins/config_generator.py11
-rw-r--r--tests/test_config_generator.py9
2 files changed, 17 insertions, 3 deletions
diff --git a/plugins/config_generator.py b/plugins/config_generator.py
index d90c5ae..d380f82 100644
--- a/plugins/config_generator.py
+++ b/plugins/config_generator.py
@@ -87,7 +87,7 @@ class GlusterNagiosConfManager:
volumeService = {}
volumeService['host_name'] = clusterName
volumeService['use'] = 'gluster-service-without-graph'
- serviceDesc = 'Volume Status Quota - %s' % (volume['name'])
+ serviceDesc = 'Volume Quota - %s' % (volume['name'])
volumeService['service_description'] = serviceDesc
volumeService['_VOL_NAME'] = volume['name']
checkCommand = 'check_vol_quota_status!%s!%s' % \
@@ -128,6 +128,13 @@ class GlusterNagiosConfManager:
service['check_command'] = 'check_cluster_vol_usage!80!90'
return service
+ def createClusterQuorumService(self, clusterName):
+ service = {}
+ service['host_name'] = clusterName
+ service['use'] = 'gluster-passive-service'
+ service['service_description'] = 'Cluster - Quorum'
+ return service
+
def createClusterAutoConfigService(self, clusterName, hostIp):
service = {}
service['host_name'] = clusterName
@@ -216,6 +223,8 @@ class GlusterNagiosConfManager:
if cluster.get('volumes'):
clusterServices.append(self.createClusterUtilizationService(
cluster['name']))
+ clusterServices.append(self.createClusterQuorumService(
+ cluster['name']))
clusterServices.append(self.createClusterAutoConfigService(
cluster['name'], cluster['hosts'][0]['hostip']))
#Create host config for Gluster cluster with volume related services
diff --git a/tests/test_config_generator.py b/tests/test_config_generator.py
index ea41e7d..e0fd8bc 100644
--- a/tests/test_config_generator.py
+++ b/tests/test_config_generator.py
@@ -65,7 +65,12 @@ class TestGlusterNagiosConfManager(TestCaseBase):
self._verifyClusterServices(config, clusterData)
def _verifyClusterServices(self, clusterConfig, clusterData):
- self.assertEqual(len(clusterConfig['host_services']), 7)
+ self.assertEqual(len(clusterConfig['host_services']), 8)
+ serviceDesc = 'Cluster - Quorum'
+ service = self._findServiceInList(clusterConfig['host_services'],
+ serviceDesc)
+ self.assertNotEqual(service, None,
+ "Cluster Quorum service is not created")
for volume in clusterData['volumes']:
self._verifyVolumeServices(clusterConfig['host_services'], volume)
@@ -78,7 +83,7 @@ class TestGlusterNagiosConfManager(TestCaseBase):
service = self._findServiceInList(serviceList, serviceDesc)
self.assertNotEqual(service, None,
"Volume Status service is not created")
- serviceDesc = 'Volume Status Quota - %s' % (volume['name'])
+ serviceDesc = 'Volume Quota - %s' % (volume['name'])
service = self._findServiceInList(serviceList, serviceDesc)
self.assertNotEqual(service, None,
"Volume Status Quota service is not created")