From 19a944e388d71b8bcae5b3da004df0d9fa846668 Mon Sep 17 00:00:00 2001 From: Nishanth Thomas Date: Mon, 19 May 2014 17:21:34 +0530 Subject: gluster-nagios-addons:when volume is down brick also will be down modified the check_proc_status plugin to make the brick to DOWN when volume is DOWN Change-Id: Iafc8294d542753de23867baefeed3db6cc8d0663 Bug-Url:https://bugzilla.redhat.com/show_bug.cgi?id=1090854 Signed-off-by: Nishanth Thomas Reviewed-on: http://review.gluster.org/7801 Reviewed-by: Kanagaraj M Reviewed-by: Shubhendu Tripathi Tested-by: Nishanth Thomas Reviewed-by: Sahina Bose --- plugins/check_proc_status.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'plugins') diff --git a/plugins/check_proc_status.py b/plugins/check_proc_status.py index 8fd3f3a..8f61048 100755 --- a/plugins/check_proc_status.py +++ b/plugins/check_proc_status.py @@ -45,14 +45,16 @@ def getBrickStatus(volInfo): bricks = {} hostUuid = glustercli.hostUUIDGet() for volumeName, volumeInfo in volInfo.iteritems(): - if volumeInfo['volumeStatus'] == glustercli.VolumeStatus.OFFLINE: - continue for brick in volumeInfo['bricksInfo']: if brick.get('hostUuid') != hostUuid: continue - status, msg = check_proc_util.getBrickStatus(volumeName, - brick['name']) brickPath = brick['name'].split(':')[1] + if volumeInfo['volumeStatus'] == glustercli.VolumeStatus.OFFLINE: + status = utils.PluginStatusCode.CRITICAL + msg = "CRITICAL: Brick %s is down" % brickPath + else: + status, msg = check_proc_util.getBrickStatus(volumeName, + brick['name']) brickService = _brickService % brickPath bricks[brickService] = [status, msg] return bricks -- cgit