summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSahina Bose <sabose@redhat.com>2014-04-15 17:59:20 +0530
committerBala.FA <barumuga@redhat.com>2014-04-29 10:21:37 +0530
commitd528a6b7ceaea54584b1a7ae6aa999fb3b86d10d (patch)
treecb74b75aac0be8c229cf8b96e590b6d0ee8bce78
parent4529ce7d5e539e42ce9d38d09d3badea3f5247ca (diff)
plugins: Fixed quota status plugin errors
Fixed the error when there's no current status for volume quota status plugin Also corrected the livestatus query Change-Id: Icb7fd0a363588c27c6237a6af397f07b5cfa6bdc Signed-off-by: Sahina Bose <sabose@redhat.com>
-rwxr-xr-xplugins/check_vol_server.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/plugins/check_vol_server.py b/plugins/check_vol_server.py
index d784e94..e8e8522 100755
--- a/plugins/check_vol_server.py
+++ b/plugins/check_vol_server.py
@@ -52,13 +52,17 @@ def execNRPECommand(command):
def _getVolumeQuotaStatusOutput(args):
# get current volume quota status
- table = livestatus.checkLiveStatus("GET services\n"
- "Columns: status plugin_output\n"
- "Filter: service_description = "
- "Volume Status Quota - " + args.volume)
- servicestatus = table[0]
- statusoutput = table[1]
- if (servicestatus == utils.PluginStatusCode.OK and
+ table = livestatus.readLiveStatus("GET services\n"
+ "Columns: state long_plugin_output\n"
+ "Filter: description = "
+ "Volume Status Quota - %s" % args.volume)
+ servicestatus = utils.PluginStatusCode.UNKNOWN
+ statusoutput = ''
+ if len(table) > 0:
+ servicetab = table[0]
+ servicestatus = servicetab[0]
+ statusoutput = servicetab[1]
+ if (int(servicestatus) == utils.PluginStatusCode.OK and
statusoutput.find("QUOTA: OK") > -1):
# if ok, don't poll
return servicestatus, statusoutput