Module: check_mk
Branch: master
Commit: 5d2da32a19eb2a011c6d21eba183f7a724b2360f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5d2da32a19eb2a…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Dec 9 09:24:11 2013 +0100
FIX Old log entries were shown in event history first
In previous versions, when the event history views had a limit
applied, like it is configured by default, it happened that
too old entries were read first. When reaching the limit of entries,
the processing stopped and newer events were ignored.
The order of the log files during processing has now been changed.
---
.werks/303 | 13 +++++++++++++
ChangeLog | 1 +
mkeventd/bin/mkeventd | 9 +++++++++
3 files changed, 23 insertions(+)
diff --git a/.werks/303 b/.werks/303
new file mode 100644
index 0000000..4d15567
--- /dev/null
+++ b/.werks/303
@@ -0,0 +1,13 @@
+Title: Old log entries were shown in event history first
+Level: 1
+Component: ec
+Version: 1.2.3i8
+Date: 1386577048
+Class: fix
+
+In previous versions, when the event history views had a limit
+applied, like it is configured by default, it happened that
+too old entries were read first. When reaching the limit of entries,
+the processing stopped and newer events were ignored.
+
+The order of the log files during processing has now been changed.
diff --git a/ChangeLog b/ChangeLog
index ad88c7f..18881cd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,7 @@
Event Console:
* 0301 Handling messages of special syslog format correctly...
+ * 0303 FIX: Old log entries were shown in event history first...
1.2.3i7:
diff --git a/mkeventd/bin/mkeventd b/mkeventd/bin/mkeventd
index df5aac8..1e5665e 100755
--- a/mkeventd/bin/mkeventd
+++ b/mkeventd/bin/mkeventd
@@ -521,6 +521,15 @@ def get_event_history(filters, limit):
timestamps = [ int(fn[:-4]) for fn in os.listdir(log_dir)
if fn.endswith(".log") ]
timestamps.sort()
+ # Use the later logfiles first, to get the newer log entries
+ # first. When a limit is reached, the newer entries should
+ # be processed in most cases. We assume that now.
+ # To keep a consistent order of log entries, we should care
+ # about sorting the log lines in reverse, but that seems to
+ # already be done by the GUI, so we don't do that twice. Skipping
+ # this # will lead into some lines of a single file to be limited in
+ # wrong order. But this should be better than before.
+ timestamps.reverse()
for ts in timestamps:
if limit != None and limit <= 0:
break