Module: check_mk
Branch: master
Commit: 5f87e9078d2cc752bc122fc7f8fa7156bb39f96e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5f87e9078d2cc7…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Jul 7 11:54:50 2014 +0200
FIX printer_supply: fix colors of Perf-O-Meter on HP OfficeJet
All Perf-O-Meters were black, because the description ended with <tt>k</tt>,
because of the word <tt>ink</tt>. This has been fixed.
---
.werks/1072 | 10 ++++++++++
ChangeLog | 2 +-
web/plugins/perfometer/check_mk.py | 12 ++++++------
3 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/.werks/1072 b/.werks/1072
new file mode 100644
index 0000000..53756e9
--- /dev/null
+++ b/.werks/1072
@@ -0,0 +1,10 @@
+Title: printer_supply: fix colors of Perf-O-Meter on HP OfficeJet
+Level: 1
+Component: checks
+Class: fix
+State: unknown
+Version: 1.2.5i5
+Date: 1404726833
+
+All Perf-O-Meters were black, because the description ended with <tt>k</tt>,
+because of the word <tt>ink</tt>. This has been fixed.
diff --git a/ChangeLog b/ChangeLog
index 2660aa4..38ab9db 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -32,7 +32,7 @@
* 0827 FIX: lnx_thermal: Not checking active trip points (e.g. cooling device
triggers) anymore
* 1043 FIX: printer_supply: fix value error in default parameters...
* 0626 FIX: veeam_jobs: agent now supports output lines longer than 80 chars
-
+ * 1072 FIX: printer_supply: fix colors of Perf-O-Meter on HP OfficeJet...
Multisite:
* 1013 Sort host names naturally, e.g. foobar11 comes after foobar2...
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index 5e35c6a..d563e64 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -668,18 +668,18 @@ def perfometer_check_mk_printer_supply(row, check_command,
perf_data):
s = row['service_description'].lower()
fg_color = '#000000'
- if 'black' in s or s[-1] == 'k':
+ if 'black' in s or ("ink" not in s and s[-1] == 'k'):
colors = [ '#000000', '#6E6F00', '#6F0000' ]
if left >= 60:
- fg_color = '#ffffff'
+ fg_color = '#FFFFFF'
elif 'magenta' in s or s[-1] == 'm':
- colors = [ '#fc00ff', '#FC7FFF', '#FEDFFF' ]
+ colors = [ '#FC00FF', '#FC7FFF', '#FEDFFF' ]
elif 'yellow' in s or s[-1] == 'y':
- colors = [ '#ffff00', '#FEFF7F', '#FFFFCF' ]
+ colors = [ '#FFFF00', '#FEFF7F', '#FFFFCF' ]
elif 'cyan' in s or s[-1] == 'c':
- colors = [ '#00ffff', '#7FFFFF', '#DFFFFF' ]
+ colors = [ '#00FFFF', '#7FFFFF', '#DFFFFF' ]
else:
- colors = [ '#cccccc', '#ffff00', '#ff0000' ]
+ colors = [ '#CCCCCC', '#ffff00', '#ff0000' ]
st = min(2, row['service_state'])
color = colors[st]