Module: check_mk
Branch: master
Commit: f0b0e880a297abec57ab2a0eea91efe8479fcbe9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f0b0e880a297ab…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Wed Mar 20 16:38:58 2019 +0100
6987 FIX Queries to event history with time filters no longer skip files with non-ASCII
characters in the first line
An encoding issue would lead to queries as used by the event history to skip files with
non-ASCII characters
in the first line, leading to events archived in that file's timerange to be omitted.
This has been fixed.
Change-Id: I671b681205e5076b17a6049dc6f5b41c4b589c25
---
.werks/6987 | 12 ++++++++++++
cmk/ec/history.py | 2 +-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/.werks/6987 b/.werks/6987
new file mode 100644
index 0000000..294c488
--- /dev/null
+++ b/.werks/6987
@@ -0,0 +1,12 @@
+Title: Event history: Fix incomplete information when using time filters (eg. Recent
Events view)
+Level: 2
+Component: ec
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1553095186
+
+An encoding issue would lead to queries as used by the event history to skip files with
non-ASCII characters
+in the first line, leading to events archived in that file's timerange to be omitted.
This has been fixed.
diff --git a/cmk/ec/history.py b/cmk/ec/history.py
index 9eaea61..20e3193 100644
--- a/cmk/ec/history.py
+++ b/cmk/ec/history.py
@@ -569,7 +569,7 @@ def _unsplit(s):
def _get_logfile_timespan(path):
try:
- with path.open() as f:
+ with path.open(encoding="utf-8") as f:
first_entry = float(f.readline().split('\t', 1)[0])
last_entry = path.stat().st_mtime
return first_entry, last_entry