From cdb615aa72b5647dbd238504b0e52390db0195cc Mon Sep 17 00:00:00 2001 From: Kanagaraj M Date: Wed, 4 Jun 2014 15:00:39 +0530 Subject: plugins: ignore offline volumes in smb/quotad monitoring Volumes which are not ONLINE will be ignored. Change-Id: I36eade96be36b39f436852b1a9570c27965d29a0 Bug-Url: https://bugzilla.redhat.com/1104490 Signed-off-by: Kanagaraj M Reviewed-on: http://review.gluster.org/7968 Reviewed-by: Sahina Bose --- plugins/check_proc_util.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'plugins') diff --git a/plugins/check_proc_util.py b/plugins/check_proc_util.py index 68bd524..3a1061b 100755 --- a/plugins/check_proc_util.py +++ b/plugins/check_proc_util.py @@ -153,9 +153,11 @@ def getSmbStatus(volInfo): # if smb is not running and any of the volume uses smb # then its required to alert the user - for k, v in volInfo.iteritems(): - cifsStatus = v.get('options', {}).get('user.cifs', 'enable') - smbStatus = v.get('options', {}).get('user.smb', 'enable') + for volume, volumeInfo in volInfo.iteritems(): + if volumeInfo['volumeStatus'] == glustercli.VolumeStatus.OFFLINE: + continue + cifsStatus = volumeInfo.get('options', {}).get('user.cifs', 'enable') + smbStatus = volumeInfo.get('options', {}).get('user.smb', 'enable') if cifsStatus == 'enable' and smbStatus == 'enable': msg = "CRITICAL: Process smb is not running" status = utils.PluginStatusCode.CRITICAL @@ -174,8 +176,10 @@ def getQuotadStatus(volInfo): # if quota is not running and any of the volume uses quota # then the quotad process should be running in the host - for k, v in volInfo.iteritems(): - quotadStatus = v.get('options', {}).get('features.quota', '') + for volume, volumeInfo in volInfo.iteritems(): + if volumeInfo['volumeStatus'] == glustercli.VolumeStatus.OFFLINE: + continue + quotadStatus = volumeInfo.get('options', {}).get('features.quota', '') if quotadStatus == 'on': msg = "CRITICAL: Process quotad is not running" utils.PluginStatusCode.CRITICAL -- cgit