diff options
author | Sahina Bose <sabose@redhat.com> | 2014-05-27 17:04:36 +0530 |
---|---|---|
committer | Sahina Bose <sabose@redhat.com> | 2014-05-28 23:04:25 -0700 |
commit | 05c2cd7c527d3a7e8b1244db72505314c3e82d3a (patch) | |
tree | ecf56513f017b8ec47214a9276cd4d3ebf5d7e0d /plugins | |
parent | 3e3dcdd9f3eea75237a7d2995e153a21d0af6e6b (diff) |
plugins: Geo-rep plugin status message enhanced
Added geo-rep session wise details to the plugin
output.
Change-Id: I2086a493c2befa4c1e25a1cc5523213f0f13c8dd
Bug-Url: https://bugzilla.redhat.com/1101218
Bug-Url: https://bugzilla.redhat.com/1101223
Signed-off-by: Sahina Bose <sabose@redhat.com>
Reviewed-on: http://review.gluster.org/7896
Diffstat (limited to 'plugins')
-rwxr-xr-x | plugins/check_volume_status.py | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/plugins/check_volume_status.py b/plugins/check_volume_status.py index e2b9205..4812e99 100755 --- a/plugins/check_volume_status.py +++ b/plugins/check_volume_status.py @@ -115,20 +115,24 @@ def getVolumeGeoRepStatus(args): exitstatus = utils.PluginStatusCode.UNKNOWN message = "UNKNOWN: Volume info not found" else: - if (volume[args.volume]['status'] == - glustercli.GeoRepStatus.PARTIAL_FAULTY): - exitstatus = utils.PluginStatusCode.WARNING - message = "Partially faulty\n %s" % volume[args.volume]['detail'] - elif volume[args.volume]['status'] == glustercli.GeoRepStatus.FAULTY: - exitstatus = utils.PluginStatusCode.CRITICAL - message = "Faulty\n %s" % volume[args.volume]['detail'] - elif (volume[args.volume]['status'] == - glustercli.GeoRepStatus.NOT_STARTED): - exitstatus = utils.PluginStatusCode.WARNING - message = "Not Started" - else: - exitstatus = utils.PluginStatusCode.OK - message = "OK" + exitstatus = utils.PluginStatusCode.OK + message = "Session status:" + detail = "Details:" + for slavename, slave_dict in volume[args.volume]['slaves'].iteritems(): + message += ("%s - %s " % (slavename, + slave_dict['status'])) + detail += ("%s - %s " % (slavename, + slave_dict['detail'])) + if slave_dict['status'] == glustercli.GeoRepStatus.FAULTY: + exitstatus = utils.PluginStatusCode.CRITICAL + elif (slave_dict['status'] + in [glustercli.GeoRepStatus.PARTIAL_FAULTY, + glustercli.GeoRepStatus.STOPPED, + glustercli.GeoRepStatus.NOT_STARTED] + and exitstatus == utils.PluginStatusCode.OK): + exitstatus = utils.PluginStatusCode.WARNING + if exitstatus != utils.PluginStatusCode.OK: + message += "\n" + detail return exitstatus, message |