Module: check_mk
Branch: master
Commit: d8e701a879fe69415eca770f65b38522800daf31
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d8e701a879fe69…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Dec 1 16:18:29 2017 +0100
5563 FIX Renamed "Site Management" configuration options introduced with #5173
The configuration options introduced with #5173 (Set OMD config via WATO) had
to be renamed. This is mostly an internal change, but you may have set one
of these options in a site using a daily master snapshot or the 1.5.0i1
version. Renaming the settings will reset your already configured settings
to default.
Change-Id: Id8c88d514d063f5a82488ae979fcc758233b3125
---
.werks/5563 | 14 ++++++++++++++
web/htdocs/watolib.py | 6 ++++++
web/plugins/wato/omd_configuration.py | 24 ++++++++++++------------
3 files changed, 32 insertions(+), 12 deletions(-)
diff --git a/.werks/5563 b/.werks/5563
new file mode 100644
index 0000000..9a31cc0
--- /dev/null
+++ b/.werks/5563
@@ -0,0 +1,14 @@
+Title: Renamed "Site Management" configuration options introduced with #5173
+Level: 1
+Component: wato
+Compatible: compat
+Edition: cre
+Version: 1.5.0i2
+Date: 1512141358
+Class: fix
+
+The configuration options introduced with #5173 (Set OMD config via WATO) had
+to be renamed. This is mostly an internal change, but you may have set one
+of these options in a site using a daily master snapshot or the 1.5.0i1
+version. Renaming the settings will reset your already configured settings
+to default.
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index 7787bad..0ae5eba 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -689,6 +689,9 @@ class ConfigDomainOMD(ConfigDomain):
else:
settings["MKEVENTD"] = None
+ # Convert from OMD key (to lower, add "site_" prefix)
+ settings = dict([ ("site_%s" % key.lower(), val) for key, val in
settings.items() ])
+
return settings
@@ -697,6 +700,9 @@ class ConfigDomainOMD(ConfigDomain):
def _to_omd_config(self, config):
settings = {}
+ # Convert to OMD key
+ config = dict([ (key.upper()[5:], val) for key, val in config.items() ])
+
if "LIVESTATUS_TCP" in config:
if config["LIVESTATUS_TCP"] is not None:
config["LIVESTATUS_TCP_PORT"] = "%s" %
config["LIVESTATUS_TCP"]["port"]
diff --git a/web/plugins/wato/omd_configuration.py
b/web/plugins/wato/omd_configuration.py
index e92ac06..67629fb 100644
--- a/web/plugins/wato/omd_configuration.py
+++ b/web/plugins/wato/omd_configuration.py
@@ -43,7 +43,7 @@ group = _('Site Management')
# '----------------------------------------------------------------------'
register_configvar(group,
- "AUTOSTART",
+ "site_autostart",
Checkbox(
title = _("Start during system boot"),
help = _("Whether or not this site should be started during startup of
"
@@ -67,7 +67,7 @@ def _monitoring_core_choices():
register_configvar(group,
- "CORE",
+ "site_core",
DropdownChoice(
title = _("Monitoring core"),
help = _("Choose the monitoring core to run for monitoring. You can also
"
@@ -81,7 +81,7 @@ register_configvar(group,
register_configvar(group,
- "LIVESTATUS_TCP",
+ "site_livestatus_tcp",
Optional(
Dictionary(
elements = [
@@ -116,7 +116,7 @@ register_configvar(group,
register_configvar(group,
- "MKEVENTD",
+ "site_mkeventd",
Optional(
ListChoice(
choices = [
@@ -142,7 +142,7 @@ register_configvar(group,
register_configvar(group,
- "NSCA",
+ "site_nsca",
Optional(
Integer(
title = _("Port number"),
@@ -358,8 +358,8 @@ class ConfigDomainApache(watolib.ConfigDomain):
output = watolib.wato_fileheader()
if config:
- output += "ServerLimit %d\n" %
config["process_tuning"]["number_of_processes"]
- output += "MaxClients %d\n" %
config["process_tuning"]["number_of_processes"]
+ output += "ServerLimit %d\n" %
config["apache_process_tuning"]["number_of_processes"]
+ output += "MaxClients %d\n" %
config["apache_process_tuning"]["number_of_processes"]
config_file_path = os.path.join(cmk.paths.omd_root,
"etc/apache/conf.d", "zzz_check_mk.conf")
store.save_file(config_file_path, output)
@@ -374,7 +374,7 @@ class ConfigDomainApache(watolib.ConfigDomain):
def default_globals(self):
return {
- "process_tuning": {
+ "apache_process_tuning": {
"number_of_processes" :
self._get_value_from_config("MaxClients", int, 64),
}
}
@@ -399,7 +399,7 @@ class ConfigDomainApache(watolib.ConfigDomain):
register_configvar(group,
- "process_tuning",
+ "apache_process_tuning",
Dictionary(
title = _("Apache process tuning"),
elements = [
@@ -460,7 +460,7 @@ class ConfigDomainRRDCached(watolib.ConfigDomain):
config = self._get_effective_config()
output = watolib.wato_fileheader()
- for key, val in sorted(config.get("tuning", {}).items()):
+ for key, val in sorted(config.get("rrdcached_tuning", {}).items()):
output += "%s=%d\n" % (key, val)
config_file_path = os.path.join(cmk.paths.omd_root, "etc/rrdcached.d",
"zzz_check_mk.conf")
@@ -475,7 +475,7 @@ class ConfigDomainRRDCached(watolib.ConfigDomain):
def default_globals(self):
return {
- "tuning": {
+ "rrdcached_tuning": {
"TIMEOUT" :
self._get_value_from_config("TIMEOUT", int, 3600),
"RANDOM_DELAY" :
self._get_value_from_config("RANDOM_DELAY", int, 1800),
"FLUSH_TIMEOUT" :
self._get_value_from_config("FLUSH_TIMEOUT", int, 7200),
@@ -502,7 +502,7 @@ class ConfigDomainRRDCached(watolib.ConfigDomain):
register_configvar(group,
- "tuning",
+ "rrdcached_tuning",
Dictionary(
title = _("RRDCached tuning"),
elements = [