Module: check_mk
Branch: master
Commit: ebc479f492455b36ad68d081450bad169186072e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ebc479f492455b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri May 20 09:05:54 2011 +0200
FIX: printer_supply perfometer: Using white font for black toners
---
ChangeLog | 1 +
web/plugins/perfometer/check_mk.py | 6 ++++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3dde4c6..a76ccdd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,7 @@
Multisite:
* Introduced basic infrastructure for multilanguage support in Multisite
* FIX: make non-Ascii characters in services names work again
+ * FIX: printer_supply perfometer: Using white font for black toners
WATO:
* Configration files can now be administered via the WEB UI
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index 068b296..8f8da49 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -319,8 +319,10 @@ def perfometer_check_mk_printer_supply(row, check_command,
perf_data):
s = row['service_description'].lower()
+ fg_color = '#000000'
if 'black' in s:
- colors = [ '#000000', '#6E6F00', '#6F0000' ]
+ colors = [ '#000000', '#6E6F00', '#6F0000' ]
+ fg_color = '#ffffff'
elif 'magenta' in s:
colors = [ '#fc00ff', '#FC7FFF', '#FEDFFF' ]
elif 'yellow' in s:
@@ -337,7 +339,7 @@ def perfometer_check_mk_printer_supply(row, check_command,
perf_data):
else:
color = colors[2]
- return "%.0f%%" % left, perfometer_linear(left, color)
+ return "<font color=\"%s\">%.0f%%</font>" %
(fg_color, left), perfometer_linear(left, color)
perfometers["check_mk-printer_supply"] = perfometer_check_mk_printer_supply