From 98b72199b7f4ce31fec0ad2fdb4c965e7fc4471b Mon Sep 17 00:00:00 2001 From: Timothy Asir Jeyasingh Date: Wed, 15 Apr 2015 12:37:45 +0530 Subject: fix glusterd service status issue This patch fixes glusterd service status issue in nagios when glusterd is hung on the node. Currently it checks the status thru pid and return the status as 'running' when it finds any pid for glusterd process. Change-Id: Ia5045cae7ef1f28d3f8bb558039f47bcbe5d101b Signed-off-by: Timothy Asir Jeyasingh Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1177129 Signed-off-by: Timothy Asir Jeyasingh Reviewed-on: http://review.gluster.org/10246 Tested-by: Timothy Asir Reviewed-by: Ramesh N Reviewed-by: Sahina Bose --- plugins/check_proc_util.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/check_proc_util.py b/plugins/check_proc_util.py index 2fe4aac..40bfd05 100755 --- a/plugins/check_proc_util.py +++ b/plugins/check_proc_util.py @@ -31,7 +31,11 @@ _checkProc = utils.CommandPath('check_proc', _chkConfig = utils.CommandPath('chkconfig', '/sbin/chkconfig', '/usr/sbin/chkconfig') +_chkService = utils.CommandPath('service', + '/sbin/service', 'usr/sbin/service') + _glusterVolPath = "/var/lib/glusterd/vols" +_checkGlusterService = [_chkService.cmd, "glusterd", "status"] _checkNfsCmd = [_checkProc.cmd, "-c", "1:", "-C", "glusterfs", "-a", "nfs"] _checkShdCmd = [_checkProc.cmd, "-c", "1:", "-C", "glusterfs", "-a", "glustershd"] @@ -39,7 +43,6 @@ _checkSmbCmd = [_checkProc.cmd, "-c", "1:", "-C", "smbd"] _checkQuotaCmd = [_checkProc.cmd, "-c", "1:", "-C", "glusterfs", "-a", "quotad"] _checkBrickCmd = [_checkProc.cmd, "-C", "glusterfsd"] -_checkGlusterdCmd = [_checkProc.cmd, "-c", "1:", "-w", "1:1", "-C", "glusterd"] _checkCtdbCmd = [_checkProc.cmd, "-c", "1:", "-C", "ctdbd"] _chkConfigCtdb = [_chkConfig.cmd, "ctdb"] checkIdeSmartCmdPath = utils.CommandPath( @@ -232,7 +235,7 @@ def getShdStatus(volInfo): def getGlusterdStatus(): - status, msg, error = utils.execCmd(_checkGlusterdCmd) + status, msg, error = utils.execCmd(_checkGlusterService) if status == utils.PluginStatusCode.OK: return status, "Process glusterd is running" elif status == utils.PluginStatusCode.CRITICAL: -- cgit