Module: check_mk
Branch: master
Commit: 9431ff40d5a7637bcdebc8c878135cfbd097e81b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9431ff40d5a763…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Mar 19 13:44:18 2015 +0100
Revert "#2060 FIX check_mk perfometer metrics: fixed exception and two new
functions"
This reverts commit 1657f0bf4967d795cac4ed710b0bfd790e2bdbca.
---
.werks/2060 | 14 --------------
ChangeLog | 1 -
web/htdocs/metrics.py | 10 +++-------
3 files changed, 3 insertions(+), 22 deletions(-)
diff --git a/.werks/2060 b/.werks/2060
deleted file mode 100644
index 4951a37..0000000
--- a/.werks/2060
+++ /dev/null
@@ -1,14 +0,0 @@
-Title: check_mk perfometer metrics: fixed exception and two new functions
-Level: 1
-Component: checks
-Compatible: compat
-Version: 1.2.7i1
-Date: 1426761345
-Class: fix
-
-Fixed an exception in dictionary perfometers when no labels were set.
-
-The "total" key in a dictionary perfometer can now be set to a fixed value.
-
-The new key "hide_label" in a dictionary perfometer hides any text.
-This might be useful in stacked/dual perfometers.
diff --git a/ChangeLog b/ChangeLog
index acd966d..7f22dfc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -265,7 +265,6 @@
* 2058 FIX: ucs_bladecenter_fans.temp, ucs_bladecenter_psu.chassis_temp: fixed broken
temperature checks (nagios only)...
* 2059 FIX: ucs_bladecenter_if: fixed exception when fibrechannel interfaces were not
configured...
* 1233 FIX: Fixed fileinfo check for solaris in case of missing files
- * 2060 FIX: check_mk perfometer metrics: fixed exception and two new functions...
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request,
added mailto link for error report...
diff --git a/web/htdocs/metrics.py b/web/htdocs/metrics.py
index fa5b41b..b5e2279 100644
--- a/web/htdocs/metrics.py
+++ b/web/htdocs/metrics.py
@@ -513,15 +513,13 @@ def build_perfometer(perfometer, translated_metrics):
summed += value
if "total" in perfometer:
- if type(perfometer["total"]) in [ int, float ]:
- total = perfometer["total"]
- else:
- total, unit, color = evaluate(perfometer["total"],
translated_metrics)
+ total, unit, color = evaluate(perfometer["total"],
translated_metrics)
else:
total = summed
if total == 0:
entry.append((100.0, "#ffffff"))
+
else:
for ex in perfometer["segments"]:
value, unit, color = evaluate(ex, translated_metrics)
@@ -540,11 +538,9 @@ def build_perfometer(perfometer, translated_metrics):
unit = unit_info[unit_name]
label = unit["render"](summed)
else: # absolute
- value, unit, color = evaluate(perfometer["segments"][0],
translated_metrics)
+ value, unit, color = evaluate(metrics_expressions[0],
translated_metrics)
label = unit["render"](summed)
- if perfometer.get("hide_label", False):
- label = ""
return label, stack