Module: check_mk
Branch: master
Commit: 803a7c8330acaa220bd95eec492e0d0da881cd3c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=803a7c8330acaa…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Sep 16 11:38:38 2015 +0200
Fix exception in graph of Check_MK service because if invalid color #888
---
web/htdocs/metrics.py | 5 ++++-
web/plugins/metrics/check_mk.py | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/metrics.py b/web/htdocs/metrics.py
index 5a1966c..f919fda 100644
--- a/web/htdocs/metrics.py
+++ b/web/htdocs/metrics.py
@@ -231,7 +231,10 @@ def hsv_to_hexrgb(hsv):
# "#ff0080" -> (1.0, 0.0, 0.5)
def parse_color(color):
- return tuple([ int(color[a:a+2], 16) / 255.0 for a in (1,3,5) ])
+ try:
+ return tuple([ int(color[a:a+2], 16) / 255.0 for a in (1,3,5) ])
+ except Exception, e:
+ raise MKGeneralException(_("Invalid color specification '%s'")
% color)
def render_color(color_rgb):
diff --git a/web/plugins/metrics/check_mk.py b/web/plugins/metrics/check_mk.py
index a2e7bbe..2a69de1 100644
--- a/web/plugins/metrics/check_mk.py
+++ b/web/plugins/metrics/check_mk.py
@@ -4495,7 +4495,7 @@ graph_info.append({
( "children_user_time", "stack" ),
( "system_time", "stack" ),
( "children_system_time", "stack" ),
- (
"user_time,children_user_time,system_time,children_system_time,+,+,+#888",
"line", _("Total") ),
+ (
"user_time,children_user_time,system_time,children_system_time,+,+,+#888888",
"line", _("Total") ),
],
})