Module: check_mk
Branch: master
Commit: 655ce9e0d251feb9d2901e5a9875d2c073587d93
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=655ce9e0d251fe…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Oct 10 17:09:12 2013 +0200
FIX: removed state-based colors from all Perf-O-Meters
---
ChangeLog | 1 +
web/plugins/perfometer/check_mk.py | 13 ++++---------
2 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 67b71d8..257b9bc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -29,6 +29,7 @@
* FIX: ldap attribute plugins: fixed crash when parameters are None
* FIX: avoid duplicate output of log message in log tables
* FIX: fixed problem with ldap userid encoding
+ * FIX: removed state-based colors from all Perf-O-Meters
* Filtering in views by Hostalias is possible now too
(however the filter is not displayed in any standard view - user needs
to enable it by customizing the needed views himself)
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index 706d5f4..52c5ac2 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -142,11 +142,7 @@ def perfometer_check_mk_mem_used(row, check_command, perf_data):
state = row["service_state"]
# paint used ram and swap
- ram_color, swap_color = {
- 0:("#80ff40", "#008030"),
- 1:("#ff2", "#dd0"),
- 2:("#f44", "#d00"),
- 3:("#fa2", "#d80") }[state]
+ ram_color, swap_color = "#80ff40", "#008030"
h += perfometer_td(100 * ram_used / virt_total, ram_color)
h += perfometer_td(100 * swap_used / virt_total, swap_color)
@@ -165,9 +161,8 @@ perfometers["check_mk-hr_mem"] =
perfometer_check_mk_mem_used
def perfometer_check_mk_mem_win(row, check_command, perf_data):
# only show mem usage, do omit page file
- base_colors = ("#20d060", "#3040d0")
state = row["service_state"]
- color = { 0: "#20d060", 1: "#ff2", 2: "#f44", 3:
"#fa2",}[state]
+ color = "#20d060"
ram_total = float(perf_data[0][6])
ram_used = float(perf_data[0][1])
perc = ram_used / ram_total * 100.0
@@ -228,7 +223,7 @@ perfometers["check_mk-systemtime"] = lambda r, c, p:
perfometer_check_mk_ntp(r,
def perfometer_ipmi_sensors(row, check_command, perf_data):
state = row["service_state"]
- color = { 0: "#39f", 1: "#ff2", 2: "#f22", 3:
"#fa2" }[state]
+ color = "#39f"
value = float(perf_data[0][1])
crit = savefloat(perf_data[0][4])
if not crit:
@@ -259,7 +254,7 @@ perfometers["check_mk-ipmi_sensors"] =
perfometer_ipmi_sensors
def perfometer_temperature(row, check_command, perf_data):
state = row["service_state"]
- color = { 0: "#39f", 1: "#ff2", 2: "#f22", 3:
"#fa2" }[state]
+ color = "#39f"
value = float(perf_data[0][1])
crit = savefloat(perf_data[0][4])
return u"%d°C" % int(value), perfometer_logarithmic(value, 40, 1.2, color)