Module: check_mk
Branch: master
Commit: 495a61df379cc4edfaf65948f2561b7be2f51da0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=495a61df379cc4…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Mar 24 13:02:46 2015 +0100
For host graphs use PNP
---
web/plugins/views/painters.py | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/web/plugins/views/painters.py b/web/plugins/views/painters.py
index 89054fb..f312bb5 100644
--- a/web/plugins/views/painters.py
+++ b/web/plugins/views/painters.py
@@ -780,16 +780,17 @@ multisite_painters["svc_group_memberlist"] = {
"paint" : paint_service_group_memberlist,
}
-# PNP Graphs
-def paint_pnpgraph(row):
- try:
- css, htmlcode = paint_svc_time_graph(row)
- if htmlcode:
- return css, htmlcode
- except NameError:
- if config.debug:
- raise
- pass
+def paint_graph(row):
+ # For hosts graphs always use PNP
+ if row.get("service_description"):
+ try:
+ css, htmlcode = paint_svc_time_graph(row)
+ if htmlcode:
+ return css, htmlcode
+ except NameError:
+ if config.debug:
+ raise
+ pass
sitename = row["site"]
host = row["host_name"]
@@ -822,7 +823,7 @@ multisite_painters["svc_pnpgraph" ] = {
"title" : _("Service Graphs"),
"columns" : [ "host_name", "service_description",
"service_perf_data", "service_check_command" ],
"options" : [ 'pnp_timerange' ],
- "paint" : paint_pnpgraph,
+ "paint" : paint_graph,
"printable" : False,
}
@@ -1175,7 +1176,7 @@ multisite_painters["host_pnpgraph" ] = {
"short" : _("PNP graph"),
"columns" : [ "host_name" ],
"options" : [ 'pnp_timerange' ],
- "paint" : paint_pnpgraph,
+ "paint" : paint_graph,
"printable" : False,
}