Module: check_mk
Branch: master
Commit: 36fd634d8098a8c636e60ca0a0d3ae215a626da3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=36fd634d8098a8…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Dec 10 15:08:50 2013 +0100
Old log entries were shown in event history first
---
doc/treasures/mknotifyd | 5 +++--
mkeventd/bin/mkeventd | 10 +++++-----
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/doc/treasures/mknotifyd b/doc/treasures/mknotifyd
index b517817..798e0df 100755
--- a/doc/treasures/mknotifyd
+++ b/doc/treasures/mknotifyd
@@ -83,7 +83,7 @@ def verbose(text, level = 1):
if opt_verbose >= level:
log(text)
-
+#.
# .--Spoolfiles Handler--------------------------------------------------.
# | ____ _ __ _ _ |
# | / ___| _ __ ___ ___ | |/ _(_) | ___ ___ |
@@ -185,6 +185,7 @@ class SpoolfilesHandler:
else:
os.remove(spoolfile_path)
+#.
# .--TCP-Server----------------------------------------------------------.
# | _____ ____ ____ ____ |
# | |_ _/ ___| _ \ / ___| ___ _ ____ _____ _ __ |
@@ -289,7 +290,7 @@ class TcpServer:
self._is_running = False
-
+#.
# .--Daemonize-----------------------------------------------------------.
# | ____ _ |
# | | _ \ __ _ ___ _ __ ___ ___ _ __ (_)_______ |
diff --git a/mkeventd/bin/mkeventd b/mkeventd/bin/mkeventd
index f81abfa..1ce3f9c 100755
--- a/mkeventd/bin/mkeventd
+++ b/mkeventd/bin/mkeventd
@@ -563,12 +563,12 @@ def parse_history_file(path, headers, filters, greptexts, limit):
line_no = 0
# If we have greptexts we pre-filter the file using the extremely
# fast GNU Grep
+ # Revert lines from the log file to have the newer lines processed first
+ cmd = 'tac "%s"' % path
if greptexts:
- args = [ 'grep', '-i', '-e' ,
".*".join(greptexts), path ]
- grep = subprocess.Popen(args, close_fds=True, stdout=subprocess.PIPE)
- logfile = grep.stdout
- else:
- logfile = file(path)
+ cmd += ' | grep -i -e %s' % ".*".join(greptexts)
+ grep = subprocess.Popen(cmd, shell = True, close_fds=True, stdout=subprocess.PIPE)
+ logfile = grep.stdout
for line in logfile:
line_no += 1