diff options
author | Timothy Asir <tjeyasin@redhat.com> | 2014-11-14 12:52:33 +0530 |
---|---|---|
committer | Sahina Bose <sabose@redhat.com> | 2014-11-17 22:15:05 -0800 |
commit | 9f572a260da19cb6ae6f2f3ee5c1a58ba6c48de7 (patch) | |
tree | d381f3985e083f740c1a95bf18f7c2e48b1bf9ec /plugins/check_proc_util.py | |
parent | abb72c79f7f2906195c0b7e33d3ad198dd372aec (diff) |
Fix bug:1119273 - invalid ctdb status message on ctdb service stop
This patch check for
if CTDB process is not running and ctdb chkconfig status is on:
then it will return "CTDB is not running", CRITICAL level
and if the CTDB process is not running and the chkconfig status is off:
then it will return "CTDB not configured", Unknown
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1119273
Change-Id: I13c586ceefc86978acd154f9c641a9cc0ffb443b
Signed-off-by: Timothy Asir <tjeyasin@redhat.com>
Reviewed-on: http://review.gluster.org/9124
Reviewed-by: Ramesh N <rnachimu@redhat.com>
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 | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/check_proc_util.py b/plugins/check_proc_util.py index af0b0e5..2fe4aac 100755 --- a/plugins/check_proc_util.py +++ b/plugins/check_proc_util.py @@ -28,6 +28,9 @@ from glusternagios import storage _checkProc = utils.CommandPath('check_proc', '/usr/lib64/nagios/plugins/check_procs') +_chkConfig = utils.CommandPath('chkconfig', + '/sbin/chkconfig', '/usr/sbin/chkconfig') + _glusterVolPath = "/var/lib/glusterd/vols" _checkNfsCmd = [_checkProc.cmd, "-c", "1:", "-C", "glusterfs", "-a", "nfs"] _checkShdCmd = [_checkProc.cmd, "-c", "1:", "-C", "glusterfs", "-a", @@ -38,6 +41,7 @@ _checkQuotaCmd = [_checkProc.cmd, "-c", "1:", "-C", "glusterfs", "-a", _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( 'check_ide_smart', '/usr/lib64/nagios/plugins/check_ide_smart') @@ -126,6 +130,10 @@ def getCtdbStatus(smbStatus, nfsStatus): status, msg, error = utils.execCmd(_checkCtdbCmd) if status != utils.PluginStatusCode.OK: + status, msg, error = utils.execCmd(_chkConfigCtdb) + if status == utils.PluginStatusCode.OK: + return (utils.PluginStatusCode.CRITICAL, + "CTDB process is not running") return utils.PluginStatusCode.UNKNOWN, "CTDB not configured" # 'cdtb nodestatus' command will return the output in following format |