Module: check_mk
Branch: master
Commit: a73eb8d8f22f04934b5eb08515efe6026e5f2f69
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a73eb8d8f22f04…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Jan 27 11:45:05 2014 +0100
FIX Fix replication with WATO if EC is enabled on master and disabled on slave
---
.werks/686 | 9 +++++++++
ChangeLog | 1 +
mkeventd/web/plugins/wato/mkeventd.py | 12 ++++++++++--
3 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/.werks/686 b/.werks/686
new file mode 100644
index 0000000..bab9928
--- /dev/null
+++ b/.werks/686
@@ -0,0 +1,9 @@
+Title: Fix replication with WATO if EC is enabled on master and disabled on slave
+Level: 1
+Component: wato
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1390819484
+
+
diff --git a/ChangeLog b/ChangeLog
index 2f7556e..dc96dcb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -232,6 +232,7 @@
* 0434 FIX: Fixed wrong count of failed hosts in bulk inventory mode...
* 0678 FIX: Move two last global settings of Event Console to proper places
* 0268 FIX: wato inventory: fixed missing services...
+ * 0686 FIX: Fix replication with WATO if EC is enabled on master and disabled on slave
Notifications:
* 0362 sms: now searching PATH for sendsms and smssend commands...
diff --git a/mkeventd/web/plugins/wato/mkeventd.py b/mkeventd/web/plugins/wato/mkeventd.py
index 5aae1a3..74ec05c 100644
--- a/mkeventd/web/plugins/wato/mkeventd.py
+++ b/mkeventd/web/plugins/wato/mkeventd.py
@@ -2014,8 +2014,16 @@ register_rule(
# | Stuff for sending monitoring notifications into the event console. |
# '----------------------------------------------------------------------'
def mkeventd_update_notifiation_configuration(hosts):
- contactgroup = config.mkeventd_notify_contactgroup
- remote_console = config.mkeventd_notify_remotehost
+ # Setup notification into the Event Console. Note: If
+ # the event console is not activated then also the global
+ # default settings are missing and we must skip this code.
+ # This can happen in a D-WATO setup where the master has
+ # enabled the EC and the slave not.
+ try:
+ contactgroup = config.mkeventd_notify_contactgroup
+ remote_console = config.mkeventd_notify_remotehost
+ except:
+ return
if not remote_console:
remote_console = ""
Module: check_mk
Branch: master
Commit: b6547aa576d20818e480bae2e0769af4ca5a457c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b6547aa576d208…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Jan 27 11:41:39 2014 +0100
Disable WATO on remote sites (werk follows in next commit)
---
web/htdocs/wato.py | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index b5226ec..bf3ec27 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -6615,6 +6615,11 @@ def save_configuration_settings(vars):
continue
per_domain.setdefault(domain, {})[varname] = vars[varname]
+ # The global setting wato_enabled is not registered in the configuration domains
+ # sind the user must not change it directly. It is set by D-WATO on slave sites.
+ if "wato_enabled" in vars:
+ per_domain.setdefault("multisite", {})["wato_enabled"] = vars["wato_enabled"]
+
for domain, domain_info in g_configvar_domains.items():
if 'save' in domain_info:
domain_info['save'](per_domain.get(domain, {}))
@@ -7646,6 +7651,13 @@ def create_site_globals_file(siteid, tmp_dir):
sites = load_sites()
site = sites[siteid]
config = site.get("globals", {})
+
+ # Add global setting for disabling WATO right here. It is not
+ # available as a normal global option. That would be too dangerous.
+ # You could disable WATO on the master very easily that way...
+ # The default value is True - even for sites configured with an
+ # older version of Check_MK.
+ config["wato_enabled"] = not site.get("disable_wato", True)
file(tmp_dir + "/sitespecific.mk", "w").write("%r\n" % config)
@@ -7851,6 +7863,9 @@ def mode_edit_site(phase):
# setting is not lost if replication is turned off for a while.
new_site["multisiteurl"] = multisiteurl
+ # Disabling of WATO
+ new_site["disable_wato"] = html.get_checkbox("disable_wato")
+
# Handle the insecure replication flag
new_site["insecure"] = html.get_checkbox("insecure")
@@ -7992,6 +8007,12 @@ def mode_edit_site(phase):
"that URL will be fetched by the Apache server of the local "
"site itself, whilst the URL-Prefix is used by your local Browser."))
+ forms.section(_("WATO"), simple=True)
+ html.checkbox("disable_wato", site.get("disable_wato", True), label = _('Disable configuration via WATO on this site'))
+ html.help( _('It is a good idea to disable access to WATO completely on the slave site. '
+ 'Otherwise a user who does not now about the replication could make local '
+ 'changes that are overridden at the next configuration activation.'))
+
forms.section(_("SSL"), simple=True)
html.checkbox("insecure", site.get("insecure", False), label = _('Ignore SSL certificate errors'))
html.help( _('This might be needed to make the synchronization accept problems with '
Module: check_mk
Branch: master
Commit: f35be4ddb2dd5b691e10e597f9bc8dcb3fbb5fef
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f35be4ddb2dd5b…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Jan 27 11:43:31 2014 +0100
Distributed WATO now disabled WATO on slave sites per default
When pushing a configuration to a slave site on that site WATO is
now disabled per default. This can be configured in the site
configuration with a new check box <i>Disable configuration via WATO on this site</i>,
which is check per default.
Disabling WATO on slave sites is a good idea, because any configuration
changes via WATO will be lost on the next synchronization.
---
.werks/685 | 14 ++++++++++++++
ChangeLog | 1 +
2 files changed, 15 insertions(+)
diff --git a/.werks/685 b/.werks/685
new file mode 100644
index 0000000..1482980
--- /dev/null
+++ b/.werks/685
@@ -0,0 +1,14 @@
+Title: Distributed WATO now disabled WATO on slave sites per default
+Level: 1
+Component: wato
+Version: 1.2.5i1
+Date: 1390819312
+Class: feature
+
+When pushing a configuration to a slave site on that site WATO is
+now disabled per default. This can be configured in the site
+configuration with a new check box <i>Disable configuration via WATO on this site</i>,
+which is check per default.
+
+Disabling WATO on slave sites is a good idea, because any configuration
+changes via WATO will be lost on the next synchronization.
diff --git a/ChangeLog b/ChangeLog
index c374413..1b82176 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -196,6 +196,7 @@
* 0448 New button in WATO service list for displaying check parameters...
* 0454 Add output of traceroute to host diagnostic page
* 0677 Make title of tags and tag groups localizable...
+ * 0685 Distributed WATO now disabled WATO on slave sites per default...
* 0057 FIX: Fix exception in WATO host editor on custom tag without topic...
* 0241 FIX: Improved sorting of WATO folders in dropdown menu...
* 0019 FIX: Fixed wording in WATO rule for MSSQL check