Module: check_mk
Branch: master
Commit: 398fd118f48cd8137e9b76e88567d519118122e7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=398fd118f48cd8…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Tue May 22 08:27:12 2018 +0200
Fixed tracking of active history period.
The EC mixed the active periods of its history and its messages, which could
lead to strange effects. Nevertheless, the bug is quite harmless because to
make it happen, you have to enable logging of messages explicitly.
Change-Id: I5b6adc02032bc170b076892265c5ed1ecfa4a5e2
---
cmk/ec/main.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/cmk/ec/main.py b/cmk/ec/main.py
index db9dfb6..8ab61d5 100644
--- a/cmk/ec/main.py
+++ b/cmk/ec/main.py
@@ -679,6 +679,7 @@ class EventServer(ECServerThread):
self._active_history_period = active_history_period
self._event_status = event_status
self._event_columns = event_columns
+ self._message_period = cmk.ec.history.ActiveHistoryPeriod()
self._time_periods = TimePeriods(self._logger)
self.create_pipe()
@@ -2188,7 +2189,7 @@ class EventServer(ECServerThread):
def log_message(self, event):
try:
- with cmk.ec.history.get_logfile(self._config,
self.settings.paths.messages_dir.value,
self._active_history_period).open(mode='ab') as f:
+ with cmk.ec.history.get_logfile(self._config,
self.settings.paths.messages_dir.value, self._message_period).open(mode='ab') as
f:
f.write("%s %s %s%s: %s\n" % (
time.strftime("%b %d %H:%M:%S",
time.localtime(event["time"])),
event["host"],