diff options
author | Nishanth Thomas <nthomas@redhat.com> | 2014-05-08 16:53:26 +0530 |
---|---|---|
committer | Sahina Bose <sabose@redhat.com> | 2014-05-13 03:23:26 -0700 |
commit | 03e3044bf148048d25367de4a7b5fda46956a80b (patch) | |
tree | 0ada038736f1fa6e13c85f22e6b4ebf725888a83 /plugins | |
parent | c1b0ce91e8b8ceb6a2a7a31741d10ecdc9e24846 (diff) |
gluster-nagios-addons : modified the plugin output for UNKNOWN
Modified the plugin output when there is failure from ligfapi
and not able to retrieve the data
Bug-Url:https://bugzilla.redhat.com/show_bug.cgi?id=1095611
Change-Id: I3b48772b80882c67d4260c036090961a97347390
Signed-off-by: Nishanth Thomas <nthomas@redhat.com>
Reviewed-on: http://review.gluster.org/7712
Reviewed-by: Sahina Bose <sabose@redhat.com>
Tested-by: Nishanth Thomas <nishusemail@gmail.com>
Diffstat (limited to 'plugins')
-rwxr-xr-x | plugins/check_vol_utilization.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/check_vol_utilization.py b/plugins/check_vol_utilization.py index d0ab5c6..151a724 100755 --- a/plugins/check_vol_utilization.py +++ b/plugins/check_vol_utilization.py @@ -27,8 +27,9 @@ def showVolumeUtilization(vname, warnLevel, critLevel): buf = {} try: buf = capacity.statvfs(vname, "localhost") - except Exception as e: - sys.stdout.write(("Volume Utilization UNKNOWN: %s\n" % str(e))) + except Exception: + sys.stdout.write("UNKNOWN: Failed to get the " + "Volume Utilization Data\n") sys.exit(utils.PluginStatusCode.UNKNOWN) # print buf @@ -60,17 +61,17 @@ def showVolumeUtilization(vname, warnLevel, critLevel): if int(vol_utilization) > critLevel: sys.stdout.write( - ("Volume Utilization CRITICAL: Utilization:%s%%" + ("CRITICAL: Utilization:%s%%" "| %s\n" % (str(int(vol_utilization)), " ".join(perfLines)))) sys.exit(utils.PluginStatusCode.CRITICAL) elif int(vol_utilization) > warnLevel: sys.stdout.write( - ("Volume Utilization WARNING: Utilization:%s%%" + ("WARNING: Utilization:%s%%" "| %s\n" % (str(int(vol_utilization)), " ".join(perfLines)))) sys.exit(utils.PluginStatusCode.WARNING) else: sys.stdout.write( - ("Volume Utilization OK: Utilization:%s%%" + ("OK: Utilization:%s%%" "| %s\n" % (str(int(vol_utilization)), " ".join(perfLines)))) sys.exit(utils.PluginStatusCode.OK) |