Module: check_mk
Branch: master
Commit: 4bce1070c5937c26ef31641cef00f57214adc0b3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4bce1070c5937c…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Wed Feb 7 10:52:33 2018 +0100
5740 FIX mkeventd: reload configuration on SIGHUP used e.g. by omd reload
Change-Id: Iea9e98b1c337e21cef0876e236fe606c44dc2521
---
.werks/5740 | 10 ++++++++++
bin/mkeventd | 19 ++++++++++++-------
2 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/.werks/5740 b/.werks/5740
new file mode 100644
index 0000000..4ef49bd
--- /dev/null
+++ b/.werks/5740
@@ -0,0 +1,10 @@
+Title: mkeventd: reload configuration on SIGHUP used e.g. by omd reload
+Level: 1
+Component: ec
+Compatible: compat
+Edition: cre
+Version: 1.5.0i3
+Date: 1517997070
+Class: fix
+
+
diff --git a/bin/mkeventd b/bin/mkeventd
index dd1d877..2fbc162 100755
--- a/bin/mkeventd
+++ b/bin/mkeventd
@@ -3780,13 +3780,7 @@ class StatusServer(ECServerThread):
log_event_history(event, "CHANGESTATE", user)
def handle_command_reload(self):
- with lock_configuration:
- load_configuration()
- initialize_snmptrap_handling()
- g_event_server.reload_configuration()
-
- g_status_server.reload_configuration()
- self.logger.info("Reloaded configuration.")
+ reload_configuration()
def handle_command_reopenlog(self):
self.logger.info("Closing this logfile")
@@ -3912,6 +3906,7 @@ def run_eventd():
except MKSignalException as e:
if e._signum == 1:
logger.info("Received SIGHUP - going to reload configuration")
+ reload_configuration()
else:
logger.info("Signalled to death by signal %d" % e._signum)
terminate()
@@ -5032,6 +5027,16 @@ def load_configuration():
g_last_config_reload = time.time()
+def reload_configuration():
+ with lock_configuration:
+ load_configuration()
+ initialize_snmptrap_handling()
+ g_event_server.reload_configuration()
+
+ g_status_server.reload_configuration()
+ logger.info("Reloaded configuration.")
+
+
def snmptrap_translation_enabled():
return g_config["translate_snmptraps"] is not False