diff options
Diffstat (limited to 'plugins')
| -rwxr-xr-x | plugins/check_vol_server.py | 15 | ||||
| -rw-r--r-- | plugins/config_generator.py | 15 |
2 files changed, 26 insertions, 4 deletions
diff --git a/plugins/check_vol_server.py b/plugins/check_vol_server.py index 0e108d0..2301e61 100755 --- a/plugins/check_vol_server.py +++ b/plugins/check_vol_server.py @@ -58,6 +58,10 @@ def _getVolSelfHealStatusNRPECommand(volume): return ("check_vol_status -a %s %s" % (volume, 'self-heal')) +def _getVolSelfHealInfoNRPECommand(volume): + return ("check_vol_status -a %s %s" % (volume, 'heal-info')) + + def _getVolGeoRepStatusNRPECommand(volume): return ("check_vol_status -a %s %s" % (volume, 'geo-rep')) @@ -223,10 +227,10 @@ def _getVolumeQuotaStatusOutput(hostgroup, volume): def _getQuorumStatusOutput(hostgroup): # get current volume quorum status table = json.loads(livestatus.readLiveStatusAsJSON("GET services\n" - "Columns: state plugin_output\n" - "Filter: description = " - "Cluster - Quorum Status\n" - "Filter: host_name = %s\n" % hostgroup)) + "Columns: state plugin_output\n" + "Filter: description = " + "Cluster - Quorum Status\n" + "Filter: host_name = %s\n" % hostgroup)) servicestatus = utils.PluginStatusCode.UNKNOWN pluginoutput = '' for row in table: @@ -294,6 +298,8 @@ def showVolumeOutput(args): command = _getVolSelfHealStatusNRPECommand(args.volume) elif args.option == 'geo-rep': command = _getVolGeoRepStatusNRPECommand(args.volume) + elif args.option == 'heal-info': + command = _getVolSelfHealInfoNRPECommand(args.volume) elif args.option == 'quorum': return _getQuorumStatusOutput(args.hostgroup) @@ -331,6 +337,7 @@ def parse_input(): 'status', 'quota', 'self-heal', + 'heal-info', 'geo-rep', 'quorum']) parser.add_argument('-t', '--timeout', diff --git a/plugins/config_generator.py b/plugins/config_generator.py index 64b093a..746cefa 100644 --- a/plugins/config_generator.py +++ b/plugins/config_generator.py @@ -121,6 +121,18 @@ class GlusterNagiosConfManager: volumeService['check_command'] = checkCommand return volumeService + def __createVolumeHealInfoService(self, volume, clusterName): + volumeService = {} + volumeService['host_name'] = clusterName + volumeService['use'] = 'gluster-heal-service-with-graph' + serviceDesc = 'Volume Heal info - %s' % (volume['name']) + volumeService['service_description'] = serviceDesc + volumeService[VOL_NAME] = volume['name'] + checkCommand = 'check_vol_heal_info!%s!%s' % \ + (clusterName, volume['name']) + volumeService['check_command'] = checkCommand + return volumeService + def __createVolumeGeoRepStatusService(self, volume, clusterName): volumeService = {} volumeService['host_name'] = clusterName @@ -174,6 +186,9 @@ class GlusterNagiosConfManager: volumeService = self.__createVolumeHealStatusService( volume, clusterName) volumeServices.append(volumeService) + volumeService = self.__createVolumeHealInfoService( + volume, clusterName) + volumeServices.append(volumeService) if volume.get('geo-rep') == "on": volumeService = self.__createVolumeGeoRepStatusService( volume, clusterName) |
