summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSahina Bose <sabose@redhat.com>2015-11-24 19:37:49 +0530
committerSahina Bose <sabose@redhat.com>2015-11-30 21:55:47 -0800
commit905769bb0f1658d8f455daaaf7dfc99526aa60e8 (patch)
tree6e54330c60878371691a0e7e27089d758c78f30f
parent96aa5f2f8d7095d6753a0bfd199783467c7d86de (diff)
nagios-plugins: fixing quorum plugin
Fixing the quorum service plugin flipping to OK state when the servers are down - due to wrong query of services BUG: 1284874 Change-Id: I5b6201f430778b92bd30c95fe3c37f4d89240eb8 Signed-off-by: Sahina Bose <sabose@redhat.com> Reviewed-on: http://review.gluster.org/12735
-rwxr-xr-xplugins/check_vol_server.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/plugins/check_vol_server.py b/plugins/check_vol_server.py
index a4a12cd..0e108d0 100755
--- a/plugins/check_vol_server.py
+++ b/plugins/check_vol_server.py
@@ -222,17 +222,16 @@ def _getVolumeQuotaStatusOutput(hostgroup, volume):
def _getQuorumStatusOutput(hostgroup):
# get current volume quorum status
- table = livestatus.readLiveStatus("GET services\n"
- "Columns: state,plugin_output\n"
+ table = json.loads(livestatus.readLiveStatusAsJSON("GET services\n"
+ "Columns: state plugin_output\n"
"Filter: description = "
- "Cluster - Quorum\n"
- "Filter: host_name = %s\n" % hostgroup)
+ "Cluster - Quorum Status\n"
+ "Filter: host_name = %s\n" % hostgroup))
servicestatus = utils.PluginStatusCode.UNKNOWN
pluginoutput = ''
- if len(table) > 0:
- servicetab = table[0]
- servicestatus = servicetab[0]
- pluginoutput = servicetab[1]
+ for row in table:
+ servicestatus = row[0]
+ pluginoutput = row[1]
if (int(servicestatus) != utils.PluginStatusCode.CRITICAL):
return _executeRandomHost(hostgroup, _getQuorumStatusNRPECommand())
else: