Module: check_mk
Branch: master
Commit: bf89c9eccdd8d7a2d4ce2f3f62231f3fb084022c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bf89c9eccdd8d7…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Sep 5 15:22:37 2011 +0200
Host comments have red backgrounded rows when host is down
---
.bugs/163 | 11 ++++++++---
.bugs/199 | 11 ++++++++---
.bugs/222 | 10 +++++++---
ChangeLog | 1 +
web/htdocs/views.py | 2 +-
web/plugins/views/layouts.py | 6 +++++-
6 files changed, 30 insertions(+), 11 deletions(-)
diff --git a/.bugs/163 b/.bugs/163
index 247510f..581a30e 100644
--- a/.bugs/163
+++ b/.bugs/163
@@ -1,10 +1,11 @@
Title: backgrounds in downtime view not shown for host downtimes
Component: multisite
+State: done
+Class: nastiness
+Date: 2011-03-01 14:42:34
Benefit: 2
-State: open
Cost: 4
-Date: 2011-03-01 14:42:34
-Class: nastiness
+Fun: 0
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).
@@ -75,3 +76,7 @@ index 135b1ed..6a870d1 100644
html.write('<tr class="data %s%d">' % (trclass,
state))
for p in painters:
+
+2011-09-05 15:21:28: changed state open -> done
+Background color is correctly shown for host rows e.g. in "Comments" view
+for example when a host is DOWN the row has lightred background
diff --git a/.bugs/199 b/.bugs/199
index 6b3d660..948b214 100644
--- a/.bugs/199
+++ b/.bugs/199
@@ -1,11 +1,16 @@
Title: <ENTER> im view editor sollte Formular abschicken
Component: multisite
+State: done
+Class: cleanup
+Date: 2011-08-31 12:56:00
Benefit: 4
-State: open
Cost: 1
-Date: 2011-08-31 12:56:00
-Class: cleanup
+Fun: 0
Wenn man viel mit Tastaturkürzeln arbeitet, nervt es, dass man im View Editor
beim Druck auf <ENTER> immer das Formular nur im "Try" Modus abschickt.
Man
sollte da das Formular eher ganz abschicken.
+
+2011-09-05 15:08:25: changed state open -> done
+Ist erledigt. Die Reihenfolge der submit Buttons ist hier scheinbar
+maßgeblich.
diff --git a/.bugs/222 b/.bugs/222
index 9b86204..303b18e 100644
--- a/.bugs/222
+++ b/.bugs/222
@@ -1,10 +1,11 @@
Title: Quicksearch should reload items after Nagios restart
Component: multisite
+State: done
+Class: feature
+Date: 2011-03-10 11:07:54
Benefit: 2
-State: open
Cost: 3
-Date: 2011-03-10 11:07:54
-Class: feature
+Fun: 0
Quicksearch should also do a refresh every 10 Seconds but only retrieve
the start time of the nagios sites. These are always available
@@ -14,3 +15,6 @@ the last time, all items (hosts, services) should be loaded new.
The See Also: should link to all check manpages concerning df.include
checks. Also there should be a table of these checks.
+
+2011-09-05 15:09:55: changed state open -> done
+Has already been implemented.
diff --git a/ChangeLog b/ChangeLog
index 2c02929..9cd5e57 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -20,6 +20,7 @@
for actions
* Sort titles in views can be enabled by clicking on the whole cells now
* Submitting the view editor via ENTER key saves the view now instead of try mode
+ * Host comments have red backgrounded rows when host is down
WATO:
* Changed row selection in WATO to new row selection mechanism
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index f7f82ad..ac20417 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -1616,7 +1616,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 104f6b4..9882dc4 100644
--- a/web/plugins/views/layouts.py
+++ b/web/plugins/views/layouts.py
@@ -377,7 +377,11 @@ def render_grouped_list(rows, 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", 0)
else:
state = 0
if trclass == "odd":