From e77dc4c7ba3506a8ca23210d5fc7ef568ef4c31c Mon Sep 17 00:00:00 2001 From: Sahina Bose Date: Wed, 16 Apr 2014 09:36:09 +0530 Subject: plugins: Added volume info as part of volume status The volume status also needs to look at the brick statuses Changed the plugin to return the volume info in case the volume is UP Change-Id: Iee0b2ad84c7a3c5d5ebdc7e0616fb6d987cfb25a Signed-off-by: Sahina Bose --- plugins/check_volume_status.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'plugins/check_volume_status.py') diff --git a/plugins/check_volume_status.py b/plugins/check_volume_status.py index df68657..7c72ef9 100755 --- a/plugins/check_volume_status.py +++ b/plugins/check_volume_status.py @@ -17,6 +17,8 @@ # import argparse +import json + from glusternagios import utils from glusternagios import glustercli @@ -32,8 +34,11 @@ def getVolumeStatus(args): return exitstatus, message elif volumes[args.volume]["volumeStatus"] == (glustercli. VolumeStatus.ONLINE): + ret_volumes = {} + ret_volumes[args.volume] = volumes.get(args.volume) + ret_volumes[args.volume]['options'] = {} exitstatus = utils.PluginStatusCode.OK - message = "OK: Volume is up" + message = ("OK: Volume is up \n%s" % json.dumps(ret_volumes)) elif volumes[args.volume]["volumeStatus"] == (glustercli. VolumeStatus.OFFLINE): exitstatus = utils.PluginStatusCode.CRITICAL -- cgit