From d6c838cd0168147031ee2f5fbcb5e3e1e774ff63 Mon Sep 17 00:00:00 2001 From: Sahina Bose Date: Wed, 10 Jun 2015 15:16:38 +0530 Subject: nagios-plugins: Return status for glusterd service check Corrected the nagios plugin return status based on the service return status Change-Id: I14e89645a0b2eacc016c9c5abb21a0bd0b85c9b3 Bug-Url: https://bugzilla.redhat.com/1177129 Signed-off-by: Sahina Bose Reviewed-on: http://review.gluster.org/11161 Reviewed-by: Ramesh N Reviewed-by: Timothy Asir --- plugins/check_proc_util.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/plugins/check_proc_util.py b/plugins/check_proc_util.py index 27d7cd4..28c19ef 100755 --- a/plugins/check_proc_util.py +++ b/plugins/check_proc_util.py @@ -242,12 +242,13 @@ def getShdStatus(volInfo): def getGlusterdStatus(): - status, msg, error = utils.execCmd(_checkGlusterService) - if status == utils.PluginStatusCode.OK: - return status, "Process glusterd is running" - elif status == utils.PluginStatusCode.CRITICAL: - return status, "Process glusterd is not running" - return status, msg[0] if len(msg) > 0 else "" + retCode, msg, error = utils.execCmd(_checkGlusterService) + if retCode == 0: + return utils.PluginStatusCode.OK, "Process glusterd is running" + elif retCode == 3: + return utils.PluginStatusCode.CRITICAL, \ + "Process glusterd is not running" + return utils.PluginStatusCode.CRITICAL, msg[0] if len(msg) > 0 else "" def hasBricks(hostUuid, bricks): -- cgit