From 37e8b7b4c96e974968f74112bd7512d6f8856b7c Mon Sep 17 00:00:00 2001 From: Sahina Bose Date: Mon, 2 Mar 2015 14:45:20 +0530 Subject: nagios-plugins: Enhanced nagios self-heal plugin Enhanced nagios self-heal plugin to report split-brain entries if found. Earlier this output was not reliable and hence was not used. With glusterfs 3.7, this issue has been fixed Change-Id: Icb79516383245839d45f4c9570c08993844fc5bd Bug-Url: https://bugzilla.redhat.com/1081900 Signed-off-by: Sahina Bose Reviewed-on: http://review.gluster.org/9783 Reviewed-by: Ramesh N --- plugins/check_volume_status.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/check_volume_status.py b/plugins/check_volume_status.py index 8c02090..8fab7ae 100755 --- a/plugins/check_volume_status.py +++ b/plugins/check_volume_status.py @@ -83,7 +83,7 @@ def getVolumeQuotaStatus(args): return utils.PluginStatusCode.OK, "QUOTA: OK" -def getVolumeSelfHealStatus(args): +def getVolumeSelfHealSplitBrainStatus(args): try: volume = glustercli.volumeHealSplitBrainStatus(args.volume) except glustercli.GlusterLockedException as e: @@ -96,7 +96,7 @@ def getVolumeSelfHealStatus(args): if volume.get(args.volume) is None: exitstatus = utils.PluginStatusCode.UNKNOWN - message = "UNKNOWN: Volume self heal info not found" + message = "UNKNOWN: Volume self heal split-brain info not found" else: if (volume[args.volume]['status'] == glustercli. VolumeSplitBrainStatus.NOTAPPLICABLE): @@ -105,11 +105,11 @@ def getVolumeSelfHealStatus(args): elif (volume[args.volume]['status'] == glustercli. VolumeSplitBrainStatus.OK): exitstatus = utils.PluginStatusCode.OK - message = "No unsynced entries present" + message = "No split brain state entries found." elif (volume[args.volume]['status'] == glustercli. VolumeSplitBrainStatus.SPLITBRAIN): - exitstatus = utils.PluginStatusCode.WARNING - message = ("Unsynced entries present %s" + exitstatus = utils.PluginStatusCode.CRITICAL + message = ("%s entries in split-brain state found." % (volume[args.volume]['unsyncedentries'])) return exitstatus, message @@ -173,7 +173,7 @@ if __name__ == '__main__': if args.type == "quota": exitstatus, message = getVolumeQuotaStatus(args) if args.type == "self-heal": - exitstatus, message = getVolumeSelfHealStatus(args) + exitstatus, message = getVolumeSelfHealSplitBrainStatus(args) if args.type == "geo-rep": exitstatus, message = getVolumeGeoRepStatus(args) print message -- cgit