From 38518cb0864e45c0a99e4c3732d636c3ec4e8518 Mon Sep 17 00:00:00 2001 From: Timothy Asir Date: Wed, 21 May 2014 17:57:40 +0530 Subject: 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 Reviewed-on: http://review.gluster.org/7826 Tested-by: Timothy Asir Reviewed-by: Sahina Bose --- plugins/check_proc_util.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'plugins') 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): -- cgit