Module: check_mk
Branch: master
Commit: c928cb9f354eb16880416440f8866a39cb3844f3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c928cb9f354eb1…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Mar 1 14:53:47 2011 +0100
Updated bug entries
---
.bugs/163 | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 77 insertions(+), 0 deletions(-)
diff --git a/.bugs/163 b/.bugs/163
new file mode 100644
index 0000000..247510f
--- /dev/null
+++ b/.bugs/163
@@ -0,0 +1,77 @@
+Title: backgrounds in downtime view not shown for host downtimes
+Component: multisite
+Benefit: 2
+State: open
+Cost: 4
+Date: 2011-03-01 14:42:34
+Class: nastiness
+
+The problem is that the host_state is not fetched via livestatus. These code parts were
written by sir hack-a-lot ;-).
+This would workaround the problem and bring the color to the host columns . And the
host_state and host_has_been_checked columns are fetched from much more views (maybe
useless in most cases).
+
+Patch:
+
+diff --git a/web/htdocs/views.py b/web/htdocs/views.py
+index e8c9498..9baddb6 100644
+--- a/web/htdocs/views.py
++++ b/web/htdocs/views.py
+@@ -1049,6 +1049,7 @@ def show_view(view, show_heading = False, show_buttons = True,
show_footer = Tru
+ if (not view["mustsearch"]) or html.var("search"):
+ # names for additional columns (through Stats: headers)
+ add_columns = datasource.get("add_columns", [])
++
+ columns, rows = query_data(datasource, columns, add_columns, query, only_sites,
get_limit())
+ sort_data(rows, sorters)
+ else:
+@@ -1356,7 +1357,7 @@ def query_data(datasource, columns, add_columns, add_headers,
only_sites = [], l
+ state_columns = []
+ if "service" in datasource["infos"]:
+ state_columns += [ "service_has_been_checked",
"service_state" ]
+- elif "host" in datasource["infos"]:
++ if "host" in datasource["infos"]:
+ state_columns += [ "host_has_been_checked", "host_state"
]
+ for c in state_columns:
+ if c not in columns:
+diff --git a/web/plugins/views/layouts.py b/web/plugins/views/layouts.py
+index 135b1ed..6a870d1 100644
+--- a/web/plugins/views/layouts.py
++++ b/web/plugins/views/layouts.py
+@@ -141,14 +141,17 @@ def render_grouped_boxes(data, view, group_painters, painters,
num_columns):
+
+ for row in rows:
+ register_events(row) # needed for playing sounds
++
+ if trclass == "odd":
+ trclass = "even"
+ else:
+ trclass = "odd"
++
+ state = row.get("service_state", None)
+ if state == None:
+ state = row.get("host_state", 0)
+ if state > 0: state +=1 # 1 is critical for hosts
++
+ html.write('<tr class="data %s%d">' % (trclass,
state))
+ for p in painters:
+ paint(p, row)
+@@ -368,13 +371,19 @@ def render_grouped_list(data, view, group_painters, painters,
num_columns):
+ # or host - if available - to color the complete line
+ if num_columns == 1:
+ # render state, if available through whole tr
+- state = row.get("service_state", 0)
++ if row.get('service_description', '') == '':
++ state = row.get("host_state", 0)
++ if state > 0: state +=1 # 1 is critical for hosts
++ else:
++ state = row.get("service_state", None)
+ else:
+ state = 0
++
+ if trclass == "odd":
+ trclass = "even"
+ else:
+ trclass = "odd"
++
+ html.write('<tr class="data %s%d">' % (trclass,
state))
+
+ for p in painters: