From f6f9efa7dd287803a197a38fdde961519883df62 Mon Sep 17 00:00:00 2001 From: Timothy Asir Jeyasingh Date: Tue, 28 Apr 2015 18:24:20 +0530 Subject: Enhance plugin to display smb status Plugin will be changed to look at chkconfig status of SMB. If turned off, plugin will report SMB service status as "Not Configured". Change-Id: I227b1215eb12066cf6367ce41388a133332e2be2 Signed-off-by: Timothy Asir Jeyasingh Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1178765 Signed-off-by: Timothy Asir Jeyasingh Reviewed-on: http://review.gluster.org/10423 Tested-by: Timothy Asir Reviewed-by: Ramesh N Reviewed-by: Sahina Bose --- plugins/check_proc_util.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'plugins/check_proc_util.py') diff --git a/plugins/check_proc_util.py b/plugins/check_proc_util.py index 40bfd05..27d7cd4 100755 --- a/plugins/check_proc_util.py +++ b/plugins/check_proc_util.py @@ -40,6 +40,7 @@ _checkNfsCmd = [_checkProc.cmd, "-c", "1:", "-C", "glusterfs", "-a", "nfs"] _checkShdCmd = [_checkProc.cmd, "-c", "1:", "-C", "glusterfs", "-a", "glustershd"] _checkSmbCmd = [_checkProc.cmd, "-c", "1:", "-C", "smbd"] +_chkConfigSmb = [_chkConfig.cmd, "smb"] _checkQuotaCmd = [_checkProc.cmd, "-c", "1:", "-C", "glusterfs", "-a", "quotad"] _checkBrickCmd = [_checkProc.cmd, "-C", "glusterfsd"] @@ -175,6 +176,10 @@ def getSmbStatus(volInfo): if status == utils.PluginStatusCode.OK: return status, "Process smb is running" + smbConfigStat, msg, error = utils.execCmd(_chkConfigSmb) + if smbConfigStat != utils.PluginStatusCode.OK: + return utils.PluginStatusCode.OK, "OK: SMB not configured" + # if smb is not running and any of the volume uses smb # then its required to alert the user for volume, volumeInfo in volInfo.iteritems(): @@ -183,10 +188,12 @@ def getSmbStatus(volInfo): cifsStatus = volumeInfo.get('options', {}).get('user.cifs', 'enable') smbStatus = volumeInfo.get('options', {}).get('user.smb', 'enable') if cifsStatus == 'enable' and smbStatus == 'enable': + # SMB configured, service not running msg = "CRITICAL: Process smb is not running" status = utils.PluginStatusCode.CRITICAL break else: + # No volumes available or Non of the volumes are CIFS enabled msg = "OK: No gluster volume uses smb" status = utils.PluginStatusCode.OK return status, msg -- cgit