From d528a6b7ceaea54584b1a7ae6aa999fb3b86d10d Mon Sep 17 00:00:00 2001 From: Sahina Bose Date: Tue, 15 Apr 2014 17:59:20 +0530 Subject: 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 --- plugins/check_vol_server.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'plugins') 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 -- cgit