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 '