summaryrefslogtreecommitdiffstats
path: root/plugins/check_proc_util.py
diff options
context:
space:
mode:
authorTimothy Asir Jeyasingh <tjeyasin@redhat.com>2015-04-28 18:24:20 +0530
committerSahina Bose <sabose@redhat.com>2015-05-14 02:31:43 -0700
commitf6f9efa7dd287803a197a38fdde961519883df62 (patch)
treef7df9acacd48ffa52aaaf1950d5553e7e9f7d359 /plugins/check_proc_util.py
parent98b72199b7f4ce31fec0ad2fdb4c965e7fc4471b (diff)
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 <tjeyasin@redhat.com> Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1178765 Signed-off-by: Timothy Asir Jeyasingh <tjeyasin@redhat.com> Reviewed-on: http://review.gluster.org/10423 Tested-by: Timothy Asir Reviewed-by: Ramesh N <rnachimu@redhat.com> Reviewed-by: Sahina Bose <sabose@redhat.com>
Diffstat (limited to 'plugins/check_proc_util.py')
-rwxr-xr-xplugins/check_proc_util.py7
1 files changed, 7 insertions, 0 deletions
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