Module: check_mk
Branch: master
Commit: 6db0c4965d7742a68cae34073327ef95ccad9750
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6db0c4965d7742…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Apr 6 10:40:30 2016 +0200
3362 FIX Fixed reload of Event Console in distributed monitoring slave site
---
.werks/3362 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/watolib.py | 16 ++++++++++++++++
web/plugins/wato/mkeventd.py | 8 --------
4 files changed, 27 insertions(+), 8 deletions(-)
diff --git a/.werks/3362 b/.werks/3362
new file mode 100644
index 0000000..749bb37
--- /dev/null
+++ b/.werks/3362
@@ -0,0 +1,10 @@
+Title: Fixed reload of Event Console in distributed monitoring slave site
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1459932013
+
+
diff --git a/ChangeLog b/ChangeLog
index 475f31c..c037d03 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -215,6 +215,7 @@
* 3357 FIX: Fixed service conditions of Disk IO related rulesets
* 3359 FIX: Fixed exception when trying to edit non existant host...
* 3361 FIX: Event Console files not synced to remote site nor backed up with WATO
snapshot
+ * 3362 FIX: Fixed reload of Event Console in distributed monitoring slave site
Notifications:
* 3263 Notifications: allow users to restrict by their contact groups...
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index 000b5a3..546a7e1 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -3606,6 +3606,12 @@ def automation_push_snapshot():
else:
configuration_warnings = []
+ # When core restart/reload is done above the EC is reloaded regularly. But
+ # even when the core does not need to be restarted, EC rules might have
+ # changed. So reload the EC in all cases.
+ if hasattr(config, "mkeventd_enabled") and
config.mkeventd_enabled:
+ mkeventd_reload()
+
return configuration_warnings
except Exception, e:
if config.debug:
@@ -3614,6 +3620,16 @@ def automation_push_snapshot():
return _("Internal automation error: %s") % e
+def mkeventd_reload():
+ import mkeventd
+ mkeventd.query("COMMAND RELOAD")
+ try:
+ os.remove(log_dir + "mkeventd.log")
+ except OSError:
+ pass # ignore not existing logfile
+ log_audit(None, "mkeventd-activate", _("Activated changes of event
console configuration"))
+
+
# Isolated restart without prior synchronization. Currently this
# is only being called for the local site.
def restart_site(site):
diff --git a/web/plugins/wato/mkeventd.py b/web/plugins/wato/mkeventd.py
index 3773a16..118dfbe 100644
--- a/web/plugins/wato/mkeventd.py
+++ b/web/plugins/wato/mkeventd.py
@@ -1556,14 +1556,6 @@ def mode_mkeventd_edit_rule(phase):
html.end_form()
-def mkeventd_reload():
- mkeventd.query("COMMAND RELOAD")
- try:
- os.remove(log_dir + "mkeventd.log")
- except OSError:
- pass # ignore not existing logfile
- log_audit(None, "mkeventd-activate", _("Activated changes of event
console configuration"))
-
# This hook is executed when one applies the pending configuration changes
# related to the mkeventd via WATO on the local system. The hook is called
# without parameters.