summaryrefslogtreecommitdiffstats
path: root/plugins/check_proc_status.py
diff options
context:
space:
mode:
authorNishanth Thomas <nthomas@redhat.com>2014-05-19 17:21:34 +0530
committerSahina Bose <sabose@redhat.com>2014-06-02 23:49:42 -0700
commit19a944e388d71b8bcae5b3da004df0d9fa846668 (patch)
tree0ee4b0781439314116f5026776d28549b7e30d3b /plugins/check_proc_status.py
parent19b6b3452546c5e9fe037eaa7121c810d45c4047 (diff)
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 <nthomas@redhat.com> Reviewed-on: http://review.gluster.org/7801 Reviewed-by: Kanagaraj M <kmayilsa@redhat.com> Reviewed-by: Shubhendu Tripathi <shtripat@redhat.com> Tested-by: Nishanth Thomas <nishusemail@gmail.com> Reviewed-by: Sahina Bose <sabose@redhat.com>
Diffstat (limited to 'plugins/check_proc_status.py')
-rwxr-xr-xplugins/check_proc_status.py10
1 files changed, 6 insertions, 4 deletions
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