Module: check_mk
Branch: master
Commit: 043d1e96044c7e40cc823d436788be9ed1b0cfe8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=043d1e96044c7e…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu May 22 10:39:53 2014 +0200
FIX Fix availability computation for hosts
The host state "down" was classified as "host_down". This lead to
incorrect numbers
for host availability.
---
.werks/890 | 10 ++++++++++
ChangeLog | 1 +
web/plugins/views/availability.py | 7 +++++--
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/.werks/890 b/.werks/890
new file mode 100644
index 0000000..9622e82
--- /dev/null
+++ b/.werks/890
@@ -0,0 +1,10 @@
+Title: Fix availability computation for hosts
+Level: 2
+Component: reporting
+Class: fix
+State: unknown
+Version: 1.2.5i3
+Date: 1400747938
+
+The host state "down" was classified as "host_down". This lead to
incorrect numbers
+for host availability.
diff --git a/ChangeLog b/ChangeLog
index 9da13c1..d92c7c1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -126,6 +126,7 @@
* 0966 CSV export for availability works now also for BI aggregates
* 0967 BI Availability timewarp: new buttons for moving back and forth
* 0962 FIX: Fix CSV-Export in availability table
+ * 0890 FIX: Fix availability computation for hosts...
Event Console:
* 0885 New option for writing all messages into a syslog-like logfile...
diff --git a/web/plugins/views/availability.py b/web/plugins/views/availability.py
index 9901ada..ccdf4ee 100644
--- a/web/plugins/views/availability.py
+++ b/web/plugins/views/availability.py
@@ -727,7 +727,7 @@ def do_render_availability(rows, what, avoptions, timeline,
timewarpcode):
consider = False
else:
s = "in_downtime"
- elif span["host_down"] and
avoptions["consider"]["host_down"]:
+ elif what != "host" and span["host_down"] and
avoptions["consider"]["host_down"]:
s = "host_down"
elif span["is_flapping"] and
avoptions["consider"]["flapping"]:
s = "flapping"
@@ -860,7 +860,7 @@ def render_timeline(timeline_rows, from_time, until_time,
considered_duration,
width = min_percentage + rest_percentage * row["duration"] /
considered_duration
html.write('<td onmouseover="timeline_hover(%d, 1);"
onmouseout="timeline_hover(%d, 0);" '
'style="width: %.1f%%" title="%s"
class="%s"></td>' % (
- row_nr, row_nr, width, title, css))
+ row_nr, row_nr, width, html.attrencode(title), css))
html.write('</tr></table>')
if style == "inline":
@@ -895,6 +895,9 @@ def render_timeline(timeline_rows, from_time, until_time,
considered_duration,
for sid, css, sname, help in availability_columns:
if sid == state_id:
table.cell(_("State"), sname, css=css + " state
narrow")
+ break
+ else:
+ table.cell(_("State"), "(%s/%s)" % (sid,sname))
table.cell(_("Additional information"), row["log_output"])
table.end()