diff options
author | Timothy Asir <tjeyasin@redhat.com> | 2014-05-21 17:57:40 +0530 |
---|---|---|
committer | Sahina Bose <sabose@redhat.com> | 2014-05-29 01:37:41 -0700 |
commit | 38518cb0864e45c0a99e4c3732d636c3ec4e8518 (patch) | |
tree | 66fe8dfb977efe5b70bf77942f87475f109358ed /plugins/check_proc_util.py | |
parent | c3ac21efd3cffc948f35527de415815644e67533 (diff) |
procstat: fix status information to show appropriate messages.
This patch fixes status information to show appropriate message
when the process is already running.
Change-Id: I82e8cb76bdbc3b2e6ee7f6e3f15fc3633a3792bc
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1089705
Signed-off-by: Timothy Asir <tjeyasin@redhat.com>
Reviewed-on: http://review.gluster.org/7826
Tested-by: Timothy Asir <tim.gluster@gmail.com>
Reviewed-by: Sahina Bose <sabose@redhat.com>
Diffstat (limited to 'plugins/check_proc_util.py')
-rwxr-xr-x | plugins/check_proc_util.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/plugins/check_proc_util.py b/plugins/check_proc_util.py index 716e9e2..68bd524 100755 --- a/plugins/check_proc_util.py +++ b/plugins/check_proc_util.py @@ -86,7 +86,7 @@ def getNfsStatus(volInfo): # if nfs is already running we need not to check further status, msg, error = utils.execCmd(_checkNfsCmd) if status == utils.PluginStatusCode.OK: - return status, msg[0] if len(msg) > 0 else "" + return status, "Process glusterfs-nfs is running" # if nfs is not running and any of the volume uses nfs # then its required to alert the user @@ -149,7 +149,7 @@ def getCtdbStatus(smbStatus, nfsStatus): def getSmbStatus(volInfo): status, msg, error = utils.execCmd(_checkSmbCmd) if status == utils.PluginStatusCode.OK: - return status, msg[0] if len(msg) > 0 else "" + return status, "Process smb is running" # if smb is not running and any of the volume uses smb # then its required to alert the user @@ -170,7 +170,7 @@ def getQuotadStatus(volInfo): # if quota is already running we need not to check further status, msg, error = utils.execCmd(_checkQuotaCmd) if status == utils.PluginStatusCode.OK: - return status, msg[0] if len(msg) > 0 else "" + return status, "Process quotad is running" # if quota is not running and any of the volume uses quota # then the quotad process should be running in the host @@ -189,7 +189,7 @@ def getQuotadStatus(volInfo): def getShdStatus(volInfo): status, msg, error = utils.execCmd(_checkShdCmd) if status == utils.PluginStatusCode.OK: - return status, msg[0] if len(msg) > 0 else "" + return status, "Gluster Self Heal Daemon is running" hostUuid = glustercli.hostUUIDGet() for volumeName, volumeInfo in volInfo.iteritems(): @@ -208,8 +208,11 @@ def getShdStatus(volInfo): def getGlusterdStatus(): status, msg, error = utils.execCmd(_checkGlusterdCmd) - msg = msg[0] if len(msg) > 0 else "" - return status, msg + 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 "" def hasBricks(hostUuid, bricks): |