diff options
author | Kanagaraj M <kmayilsa@redhat.com> | 2014-06-04 15:00:39 +0530 |
---|---|---|
committer | Sahina Bose <sabose@redhat.com> | 2014-06-05 02:29:25 -0700 |
commit | cdb615aa72b5647dbd238504b0e52390db0195cc (patch) | |
tree | 4c1c0971f33b808290056f8d8f0301b89e911d98 | |
parent | 3bdb656a46c40282449ac69ec753c0b8ef271f48 (diff) |
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 <kmayilsa@redhat.com>
Reviewed-on: http://review.gluster.org/7968
Reviewed-by: Sahina Bose <sabose@redhat.com>
-rwxr-xr-x | plugins/check_proc_util.py | 14 |
1 files changed, 9 insertions, 5 deletions
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 |