summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorSahina Bose <sabose@redhat.com>2014-04-24 16:35:27 +0530
committerSahina Bose <sabose@redhat.com>2014-05-01 23:22:40 -0700
commitd5f6c2145bb37d7607d3f05329c0efca3c398fae (patch)
tree9aeb1736c3f5ce3681a328847ae4e4e8d6dad5af /plugins
parentdd16d35b465974b17dfafd29006e8124f04c34e0 (diff)
plugins: Server side plugin for geo-rep
Added server side plugin option for geo-rep status Change-Id: I6f604862ec7d4813298a670b7ed2cc0b448faf23 Signed-off-by: Sahina Bose <sabose@redhat.com> Reviewed-on: http://review.gluster.org/7592
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/check_vol_server.py9
-rw-r--r--plugins/config_generator.py16
2 files changed, 24 insertions, 1 deletions
diff --git a/plugins/check_vol_server.py b/plugins/check_vol_server.py
index 4e99eb6..1cc043f 100755
--- a/plugins/check_vol_server.py
+++ b/plugins/check_vol_server.py
@@ -46,6 +46,10 @@ def _getVolSelfHealStatusNRPECommand(args):
return ("check_vol_status -a %s %s" % (args.volume, 'self-heal'))
+def _getVolGeoRepStatusNRPECommand(args):
+ return ("check_vol_status -a %s %s" % (args.volume, 'geo-rep'))
+
+
def _getNRPEBaseCmd(host):
return NRPE_PATH + " -H " + host + " -c "
@@ -140,6 +144,8 @@ def showVolumeOutput(args):
return _getVolumeQuotaStatusOutput(args)
elif args.option == 'self-heal':
command = _getVolSelfHealStatusNRPECommand(args)
+ elif args.option == 'geo-rep':
+ command = _getVolGeoRepStatusNRPECommand(args)
return _executeRandomHost(command)
@@ -174,7 +180,8 @@ def parse_input():
choices=['utilization',
'status',
'quota',
- 'self-heal'])
+ 'self-heal',
+ 'geo-rep'])
args = parser.parse_args()
if args.critical <= args.warning:
print "UNKNOWN:Critical must be greater than Warning."
diff --git a/plugins/config_generator.py b/plugins/config_generator.py
index e7d35fd..d90c5ae 100644
--- a/plugins/config_generator.py
+++ b/plugins/config_generator.py
@@ -108,6 +108,18 @@ class GlusterNagiosConfManager:
volumeService['check_command'] = checkCommand
return volumeService
+ def __createVolumeGeoRepStatusService(self, volume, clusterName):
+ volumeService = {}
+ volumeService['host_name'] = clusterName
+ volumeService['use'] = 'gluster-service-without-graph'
+ serviceDesc = 'Volume Geo-Replication - %s' % (volume['name'])
+ volumeService['service_description'] = serviceDesc
+ volumeService['_VOL_NAME'] = volume['name']
+ checkCommand = 'check_vol_georep_status!%s!%s' % \
+ (clusterName, volume['name'])
+ volumeService['check_command'] = checkCommand
+ return volumeService
+
def createClusterUtilizationService(self, clusterName):
service = {}
service['host_name'] = clusterName
@@ -140,6 +152,10 @@ class GlusterNagiosConfManager:
__createVolumeHealStatusService(volume,
clusterName))
volumeServices.append(volumeService)
+ volumeService = (self.
+ __createVolumeGeoRepStatusService(volume,
+ clusterName))
+ volumeServices.append(volumeService)
volumeService = self.__createVolumeStatusService(volume,
clusterName)
volumeServices.append(volumeService)