Module: check_mk
Branch: master
Commit: 824cf5a6acf73b9ce46d0db4c22fb883b3091e8e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=824cf5a6acf73b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Apr 30 14:45:06 2013 +0200
Improved esx datastore perfometer
---
web/plugins/perfometer/check_mk.py | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index 38c33a7..5c09397 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -79,7 +79,6 @@ def perfometer_esx_vsphere_datastores(row, check_command, perf_data):
perc_used = 100 * (float(used_mb) / float(maxx))
perc_uncommitted = 100 * (float(uncommitted_mb) / float(maxx))
perc_totally_free = 100 - perc_used - perc_uncommitted
- perc_free = 100 - perc_used
h = '<table><tr>'
if perc_used + perc_uncommitted <= 100:
@@ -91,11 +90,11 @@ def perfometer_esx_vsphere_datastores(row, check_command, perf_data):
# Visualize overcommitted space by scaling to total overcommittment value
# and drawing the capacity as red line in the perfometer
total = perc_used + perc_uncommitted
- perc_used = perc_used * 100 / total
- perc_uncommitted = perc_uncommitted * 100 / total
- perc_free = perc_free * 100 / total
+ perc_used_bar = perc_used * 100 / total
+ perc_uncommitted_bar = perc_uncommitted * 100 / total
+ perc_free = (100 - perc_used) * 100 / total
- h += perfometer_td(perc_used, "#00ffc6")
+ h += perfometer_td(perc_used_bar, "#00ffc6")
h += perfometer_td(perc_free, "#eeccff")
h += perfometer_td(1, "red") # This line visualizes the capacity
h += perfometer_td(perc_uncommitted - perc_free, "#eeccff")