diff options
author | Ramesh Nachimuthu <rnachimu@redhat.com> | 2014-04-09 12:32:52 +0530 |
---|---|---|
committer | Bala.FA <barumuga@redhat.com> | 2014-04-29 10:21:37 +0530 |
commit | 5c545b302479c672c9e7e8410d2044b1350198fa (patch) | |
tree | d2580e38f5cbb9f9951ad05fa088bae67de526fd /plugins | |
parent | 197ff6c25b79442e0f813ab36a8437a3f8335c48 (diff) |
autoconf: refactoring auto conf
Following small changes have been made in auto conf.
1. Create Cluster utilization service only when there is atleast
one volume in the cluster.
2. Change the auto config to use the same host given during manual
run for further auto syncing.
3. Change the "gluster_auto_discovery" command to passss the
cluster name to auto discovery using $HOSTNAME$ macro
Change-Id: Id30e0794d98ada4a0276af0c17781f8742dc14e5
Signed-off-by: Ramesh Nachimuthu <rnachimu@redhat.com>
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/config_generator.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/config_generator.py b/plugins/config_generator.py index 041ee8b..1f0be4e 100644 --- a/plugins/config_generator.py +++ b/plugins/config_generator.py @@ -96,8 +96,7 @@ class GlusterNagiosConfManager: service['host_name'] = clusterName service['use'] = 'generic-service' service['service_description'] = 'Cluster Auto Config' - service['check_command'] = "gluster_auto_discovery!%s!%s" % ( - hostIp, clusterName) + service['check_command'] = "gluster_auto_discovery!%s" % (hostIp) service['check_interval'] = '1440' return service @@ -141,10 +140,12 @@ class GlusterNagiosConfManager: hostsConfigs = [] clusterServices = self.createrVolumeServices( cluster.get('volumes'), cluster['name']) - clusterServices.append(self.createClusterUtilizationService( - cluster['name'])) + # If there are volumes, then create a cluster utilization service at cluster level + if cluster.get('volumes'): + clusterServices.append(self.createClusterUtilizationService( + cluster['name'])) clusterServices.append(self.createClusterAutoConfigService( - cluster['name'], cluster['hosts'][0]['hostip'])) + cluster['name'], cluster['hosts'][-1]['hostip'])) clusterHostConfig = self.createHost( cluster['name'], cluster['name'], "gluster-cluster", cluster['name'], "", "check_dummy", clusterServices) |