Module: check_mk
Branch: master
Commit: 7cf365e365a95a31759d52aa1dd852b44ccb47fe
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7cf365e365a95a…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed May 2 12:43:52 2018 +0200
5996 FIX Fixed lookup of management protocol and credentials
If a host has configured a SNMP management board in Check_MK
version 1.4.0 and the site was upgraded to 1.5.0 or later versions,
then the SNMP management board protocol and credentials were not
found. Fixed that!
Change-Id: Ica7446639b802c0924d5f3740007723a2291c838
---
.werks/5996 | 13 +++++++++++++
cmk_base/config.py | 21 +++++++++++++++++++++
web/htdocs/watolib.py | 4 ++--
3 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/.werks/5996 b/.werks/5996
new file mode 100644
index 0000000..9e250ad
--- /dev/null
+++ b/.werks/5996
@@ -0,0 +1,13 @@
+Title: Fixed lookup of management protocol and credentials
+Level: 1
+Component: wato
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1525257689
+Class: fix
+
+If a host has configured a SNMP management board in Check_MK
+version 1.4.0 and the site was upgraded to 1.5.0 or later versions,
+then the SNMP management board protocol and credentials were not
+found. Fixed that!
diff --git a/cmk_base/config.py b/cmk_base/config.py
index 5b297c4..43df660 100644
--- a/cmk_base/config.py
+++ b/cmk_base/config.py
@@ -126,6 +126,8 @@ def load(with_conf_d=True, validate_hosts=True, exclude_parents_mk=False):
_load_config(with_conf_d, exclude_parents_mk)
+ _transform_mgmt_config_vars_from_140_to_150()
+
initialize_config_caches()
initialize_service_levels()
@@ -196,6 +198,21 @@ def _load_config(with_conf_d, exclude_parents_mk):
del global_dict[helper_var]
+def _transform_mgmt_config_vars_from_140_to_150():
+ #FIXME We have to transform some configuration variables from host attributes
+ # to cmk_base configuration variables because during the migration step from
+ # 1.4.0 to 1.5.0 some config variables are not known in cmk_base. These variables
+ # are 'management_protocol' and 'management_snmp_community'.
+ # Clean this up one day!
+ for hostname, attributes in host_attributes.iteritems():
+ for name, var in [
+ ('management_protocol', management_protocol),
+ ('management_snmp_community', management_snmp_credentials),
+ ]:
+ if attributes.get(name):
+ var.setdefault(hostname, attributes[name])
+
+
# Create list of all files to be included during configuration loading
def _get_config_file_paths(with_conf_d):
if with_conf_d:
@@ -594,6 +611,10 @@ def alias_of(hostname, fallback):
def get_additional_ipaddresses_of(hostname):
+ #TODO Regarding the following configuration variables from WATO
+ # there's no inheritance, thus we use 'host_attributes'.
+ # Better would be to use cmk_base configuration variables,
+ # eg. like 'management_protocol'.
return (host_attributes.get(hostname, {}).get("additional_ipv4addresses", []),
host_attributes.get(hostname, {}).get("additional_ipv6addresses", []))
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index 25adefe..a99f7d0 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -1465,9 +1465,9 @@ class CREFolder(BaseFolder):
("ipaddress", "ipaddresses", {}, "Explicit IPv4 addresses"),
("ipv6address", "ipv6addresses", {}, "Explicit IPv6 addresses"),
("snmp_community", "explicit_snmp_communities", {}, "Explicit SNMP communities"),
- ("management_snmp_community", "management_snmp_credentials", {}, "Management board SNMP credentials"),
+ ("management_snmp_community", "management_snmp_credentials", {}, "Management board SNMP credentials"),
("management_ipmi_credentials", "management_ipmi_credentials", {}, "Management board IPMI credentials"),
- ("management_protocol", "management_protocol", {}, "Management board protocol"),
+ ("management_protocol", "management_protocol", {}, "Management board protocol"),
]
for hostname in hostnames:
Module: check_mk
Branch: master
Commit: ab75928e4efea0825cb31938e77f03a046fa44ba
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ab75928e4efea0…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon May 7 06:33:54 2018 +0200
6056 Analyze configuration: Test for old omdadmin default credentials
A new "Analyze configuration" test warns you in case a omdadmin user with the pre
1.4 default password is found in the site.
Change-Id: I788abe3e0eedf1021fbc77340baf34ee54608611
---
.werks/6056 | 12 ++++++++++++
web/plugins/wato/ac_tests.py | 32 ++++++++++++++++++++++++++++++++
2 files changed, 44 insertions(+)
diff --git a/.werks/6056 b/.werks/6056
new file mode 100644
index 0000000..22aec27
--- /dev/null
+++ b/.werks/6056
@@ -0,0 +1,12 @@
+Title: Analyze configuration: Test for old omdadmin default credentials
+Level: 1
+Component: wato
+Class: feature
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1525628120
+
+A new "Analyze configuration" test warns you in case a omdadmin user with the pre
+1.4 default password is found in the site.
diff --git a/web/plugins/wato/ac_tests.py b/web/plugins/wato/ac_tests.py
index 17b549a..7c662b5 100644
--- a/web/plugins/wato/ac_tests.py
+++ b/web/plugins/wato/ac_tests.py
@@ -256,6 +256,38 @@ class ACTestHTTPSecured(ACTest):
+class ACTestOldDefaultCredentials(ACTest):
+ def category(self):
+ return ACTestCategories.security
+
+
+ def title(self):
+ return _("Default credentials")
+
+
+ def help(self):
+ return _("In versions prior to version 1.4.0 the first administrative user of the "
+ "site was named <tt>omdadmin</tt> with the standard password <tt>omd</tt>. "
+ "This test warns you in case the site uses these standard credentials. "
+ "It is highly recommended to change this password.")
+
+
+ def is_relevant(self):
+ return userdb.user_exists("omdadmin")
+
+
+ def execute(self):
+ if userdb.HtpasswdUserConnector({}).check_credentials("omdadmin", "omd") == "omdadmin":
+ yield ACResultCRIT(_("Found <tt>omdadmin</tt> with default password. "
+ "It is highly recommended to change this password."))
+ else:
+ yield ACResultOK(_("Found <tt>omdadmin</tt> using custom password."))
+
+
+
+
+
+
class ACTestBackupConfigured(ACTest):
def category(self):
return ACTestCategories.reliability
Module: check_mk
Branch: master
Commit: 824116ba7aca79f3cbb69720c0884b1045c299ed
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=824116ba7aca79…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Apr 18 08:15:52 2018 +0200
5986 FIX User synchronization is now using background job mechanism
To prevent timeouts of the GUI when manually starting the user synchronization
the user synchronization is now performed as background job. You can either
have a log at the state of the current/last job from the Users page or the
list of all background jobs.
Change-Id: I94a3924de2b28e46d6bead373f77079622061d12
---
.werks/5986 | 14 ++++++
web/htdocs/userdb.py | 120 ++++++++++++++++++++++++++-------------------
web/htdocs/views.py | 7 ---
web/htdocs/wato.py | 85 +++++++++++++++++++++++++++++---
web/plugins/userdb/ldap.py | 38 ++------------
5 files changed, 164 insertions(+), 100 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=824116ba7a…