diff options
author | Sahina Bose <sabose@redhat.com> | 2015-06-10 15:16:38 +0530 |
---|---|---|
committer | Sahina Bose <sabose@redhat.com> | 2015-06-11 23:59:37 -0700 |
commit | d6c838cd0168147031ee2f5fbcb5e3e1e774ff63 (patch) | |
tree | 4110059317aefa18ecf0635803f8e9d2806d87e0 | |
parent | 561cfbf91a10fdfcbae64dad8c8bc098c513d18b (diff) |
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 <sabose@redhat.com>
Reviewed-on: http://review.gluster.org/11161
Reviewed-by: Ramesh N <rnachimu@redhat.com>
Reviewed-by: Timothy Asir
-rwxr-xr-x | plugins/check_proc_util.py | 13 |
1 files 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): |