Module: check_mk
Branch: master
Commit: 45eb8f68a416135fbabf0ed249f0287b78bd401b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=45eb8f68a41613…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jun 22 08:25:00 2017 +0200
4893 FIX Fixed creation of default "local" site
Previous 1.4 versions were creating a new distributed monitoring site
when there did not exist a site named exactly like the site ID of the
central site.
WATO now only creates this default site entry when there is no site
configured at all.
Change-Id: If6bd65869fdeb2e27d8edf340e4f43fc92c6fe91
---
.werks/4893 | 16 ++++++++++++++++
web/htdocs/config.py | 6 +++++-
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/.werks/4893 b/.werks/4893
new file mode 100644
index 0000000..3ff21a5
--- /dev/null
+++ b/.werks/4893
@@ -0,0 +1,16 @@
+Title: Fixed creation of default "local" site
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1498112602
+
+Previous 1.4 versions were creating a new distributed monitoring site
+when there did not exist a site named exactly like the site ID of the
+central site.
+
+WATO now only creates this default site entry when there is no site
+configured at all.
diff --git a/web/htdocs/config.py b/web/htdocs/config.py
index 82f7f0d..03e15eb 100644
--- a/web/htdocs/config.py
+++ b/web/htdocs/config.py
@@ -129,6 +129,10 @@ def load_config():
# Set default values for all user-changable configuration settings
load_plugins(True)
+ # Initialze sites with default site configuration. Need to do it here to
+ # override possibly deleted sites
+ sites = default_single_site_configuration()
+
# First load main file
include("multisite.mk")
@@ -634,7 +638,7 @@ def default_single_site_configuration():
'user_login' : True,
}}
-sites = default_single_site_configuration()
+sites = {}
def sitenames():
return sites.keys()
Module: check_mk
Branch: master
Commit: b059c06de03ecf40090582680af5ce52d0823035
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b059c06de03ecf…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jun 21 21:20:34 2017 +0200
Trusted CAs: Fixed error reporting during initial WATO config creation
Change-Id: Ib2084851fac6a6a745dd2b2686489b026e3ba8d2
---
web/htdocs/watolib.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index f18b7fe..4e0bdbef 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -440,9 +440,11 @@ class ConfigDomainCACertificates(ConfigDomain):
# We need to activate this immediately to make syncs to WATO slave sites
# possible right after changing the option
- configuration_warnings = self._update_trusted_cas(current_config)
- if configuration_warnings:
- raise MKUserError(None, ", ".join(configuration_warnings))
+ #
+ # Since this can be called from any WATO page it is not possible to report
+ # errors to the user here. The self._update_trusted_cas() method logs the
+ # errors - this must be enough for the moment.
+ self._update_trusted_cas(current_config)
def activate(self):
Module: check_mk
Branch: master
Commit: 26c76a937228e20db4479986a1db7b8a12540712
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=26c76a937228e2…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jun 21 19:06:53 2017 +0200
4892 FIX Cleanup site changes of deleted sites correctly
When a site was replicated via WATO before and is deleted, the file where
the pending changes of that site were stored was left in the master site.
The path to the file is "var/check_mk/wato/replication_changes_[site].mk".
In case you have files for old sites you can savely delete them.
Change-Id: I98eb375e43300fc5f9551987b4fc703c2f96d0d6
---
.werks/4892 | 15 +++++++++++++++
web/htdocs/watolib.py | 2 ++
2 files changed, 17 insertions(+)
diff --git a/.werks/4892 b/.werks/4892
new file mode 100644
index 0000000..a269ed1
--- /dev/null
+++ b/.werks/4892
@@ -0,0 +1,15 @@
+Title: Cleanup site changes of deleted sites correctly
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1498064706
+
+When a site was replicated via WATO before and is deleted, the file where
+the pending changes of that site were stored was left in the master site.
+
+The path to the file is "var/check_mk/wato/replication_changes_[site].mk".
+In case you have files for old sites you can savely delete them.
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index 40e1c8d..f18b7fe 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -4042,6 +4042,8 @@ def clear_site_replication_status(site_id):
else:
raise
+ ActivateChanges().confirm_site_changes(site_id)
+
def site_replication_status_path(site_id):
return "%sreplication_status_%s.mk" % (var_dir, site_id)
Module: check_mk
Branch: master
Commit: 9e00cf47a30f28dad94ce11c4c91bcf0bcacac8e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9e00cf47a30f28…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jun 21 18:32:32 2017 +0200
4891 FIX Trusted CA certificate file is now updated during all WATO activations
The trusted CA file (var/ssl/ca-certificates.crt) which is needed for validating
SSL certificates e.g. when doing WATO syncs or using SSL during monitoring is now
written during each WATO activation, regardless of the changes which are activated.
Change-Id: Ia85ef320cfd7a32d1981aeffacc8573b660d5b2e
---
.werks/4891 | 13 +++++++++++++
web/htdocs/watolib.py | 29 ++++++++++++++++++++++++-----
2 files changed, 37 insertions(+), 5 deletions(-)
diff --git a/.werks/4891 b/.werks/4891
new file mode 100644
index 0000000..3bafee7
--- /dev/null
+++ b/.werks/4891
@@ -0,0 +1,13 @@
+Title: Trusted CA certificate file is now updated during all WATO activations
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1498061583
+
+The trusted CA file (var/ssl/ca-certificates.crt) which is needed for validating
+SSL certificates e.g. when doing WATO syncs or using SSL during monitoring is now
+written during each WATO activation, regardless of the changes which are activated.
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index d138830..f96f4d0 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -258,6 +258,7 @@ def get_number_of_pending_changes():
class ConfigDomain(object):
needs_sync = True
needs_activation = True
+ always_activate = False
ident = None
in_global_settings = True
@@ -280,6 +281,11 @@ class ConfigDomain(object):
@classmethod
+ def get_always_activate_domain_idents(cls):
+ return [ d.ident for d in cls.all_classes() if d.always_activate ]
+
+
+ @classmethod
def get_class(cls, ident):
for domain_class in cls.all_classes():
if domain_class.ident == ident:
@@ -399,6 +405,7 @@ class ConfigDomainEventConsole(ConfigDomain):
class ConfigDomainCACertificates(ConfigDomain):
needs_sync = True
needs_activation = True
+ always_activate = True # Execute this on all sites on all activations
ident = "ca-certificates"
trusted_cas_file = "%s/var/ssl/ca-certificates.crt" % cmk.paths.omd_root
@@ -423,23 +430,33 @@ class ConfigDomainCACertificates(ConfigDomain):
return os.path.join(self.config_dir(), "ca-certificates.mk")
+ def save(self, settings, site_specific=False):
+ super(ConfigDomainCACertificates, self).save(settings, site_specific=site_specific)
+
+ # We need to activate this immediately to make syncs to WATO slave sites
+ # possible right after changing the option
+ configuration_warnings = self._update_trusted_cas(settings["trusted_certificate_authorities"])
+ if configuration_warnings:
+ raise MKUserError(None, ", ".join(configuration_warnings))
+
+
def activate(self):
try:
- return self._update_trusted_cas()
+ return self._update_trusted_cas(config.trusted_certificate_authorities)
except Exception, e:
log_exception()
return ["Failed to create trusted CA file '%s': %s" %
(self.trusted_cas_file, traceback.format_exc())]
- def _update_trusted_cas(self):
+ def _update_trusted_cas(self, current_config):
trusted_cas, errors = [], []
- if config.trusted_certificate_authorities["use_system_wide_cas"]:
+ if current_config["use_system_wide_cas"]:
trusted, errors = self._get_system_wide_trusted_ca_certificates()
trusted_cas += trusted
- trusted_cas += config.trusted_certificate_authorities["trusted_cas"]
+ trusted_cas += current_config["trusted_cas"]
store.save_file(self.trusted_cas_file, "\n".join(trusted_cas))
return errors
@@ -5326,8 +5343,10 @@ class ActivateChangesSite(multiprocessing.Process, ActivateChanges):
def execute_activate_changes(domains):
+ domains = set(domains).union(ConfigDomain.get_always_activate_domain_idents())
+
results = {}
- for domain in domains:
+ for domain in sorted(domains):
domain_class = ConfigDomain.get_class(domain)
warnings = domain_class().activate()
results[domain] = warnings or []
Module: check_mk
Branch: master
Commit: dc7293366648cc6d69303e1e9e2aad1ec3bbb11d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dc7293366648cc…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Jun 21 15:23:19 2017 +0200
4837 netapp_api_if: a grouped interface now reports a WARNING when one of its member interfaces is down
Change-Id: I1d52571861ae8647f3232bd1d256e23b22fc35d9
---
.werks/4837 | 11 +++++++++++
checks/netapp_api_if | 26 +++++++++++++++++++++-----
2 files changed, 32 insertions(+), 5 deletions(-)
diff --git a/.werks/4837 b/.werks/4837
new file mode 100644
index 0000000..4c6145d
--- /dev/null
+++ b/.werks/4837
@@ -0,0 +1,11 @@
+Title: netapp_api_if: a grouped interface now reports a WARNING when one of its member interfaces is down
+Level: 1
+Component: checks
+Class: feature
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1498051336
+
+
diff --git a/checks/netapp_api_if b/checks/netapp_api_if
index 9d3393c..2d55839 100644
--- a/checks/netapp_api_if
+++ b/checks/netapp_api_if
@@ -73,7 +73,7 @@ def netapp_convert_to_if64(info):
if "mac-address" in values:
if_mac_list.setdefault(values["mac-address"], [])
- if_mac_list[values["mac-address"]].append(name)
+ if_mac_list[values["mac-address"]].append((name, values.get("state")))
nics = []
@@ -98,7 +98,7 @@ def netapp_convert_to_if64(info):
max_speed = 0
min_speed = 1024**5
- for tmp_if in mac_list:
+ for tmp_if, state in mac_list:
if tmp_if == nic_name or "speed" not in interfaces[tmp_if]:
continue
check_speed = interfaces[tmp_if]["speed"]
@@ -111,7 +111,7 @@ def netapp_convert_to_if64(info):
# Virtual interfaces is "Up" if at least one physical interface is up
if "state" not in values:
if "mac-address" in values:
- for tmp_if in if_mac_list[values["mac-address"]]:
+ for tmp_if, state in if_mac_list[values["mac-address"]]:
if interfaces[tmp_if].get("state") == "1":
state = "1"
break
@@ -168,14 +168,30 @@ def check_netapp_api_if(item, params, parsed):
ifDescr_cln = cleanup_if_strings(ifDescr)
ifAlias_cln = cleanup_if_strings(ifAlias)
+ first_member = True
if if_item_matches(item, ifIndex, ifAlias_cln, ifDescr_cln):
if ifDescr in extra_info:
vif_group = extra_info[ifDescr]
- yield 0, "Physical interfaces: %s" %\
- ", ".join([group for group in vif_group["grouped_if"] if group != ifDescr])
+ member_info = []
+ for member_name, member_state in vif_group["grouped_if"]:
+ if member_state == None or member_name == ifDescr:
+ continue # Not a real member or the grouped interface itself
+
+ if member_state == "2":
+ state = 1
+ else:
+ state = 0
+
+ if first_member:
+ yield state, "Physical interfaces: %s(%s)" % (member_name, if_statename(member_state))
+ first_member = False
+ else:
+ yield state, "%s(%s)" % (member_name, if_statename(member_state))
+
if "speed_differs" in vif_group:
yield 1, "Interfaces do not have the same speed"
+
check_info["netapp_api_if"] = {
'check_function' : check_netapp_api_if,
'inventory_function' : inventory_netapp_api_if,
Module: check_mk
Branch: master
Commit: 27cd22c24e46be8fb921bb6c82a845db6581a877
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=27cd22c24e46be…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Jun 21 14:22:19 2017 +0200
4836 FIX Notifications rules: Modifying a rule always set the option "allow users to deactivate this notification"
Change-Id: Ic52cad80b5a0d5233fc4137fb73540d9071ab4bd
---
.werks/4836 | 10 ++++++++++
web/htdocs/wato.py | 8 ++++++--
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/.werks/4836 b/.werks/4836
new file mode 100644
index 0000000..6453ffa
--- /dev/null
+++ b/.werks/4836
@@ -0,0 +1,10 @@
+Title: Notifications rules: Modifying a rule always set the option "allow users to deactivate this notification"
+Level: 1
+Component: notifications
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1498047540
+Class: fix
+
+
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index a29e0be..95d112e 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -8642,8 +8642,12 @@ def mode_notification_rule(phase, profilemode):
vs.validate_value(rule, "rule")
- # User rules are always allow_disable
- rule["allow_disable"] = True
+ if userid:
+ # User rules are always allow_disable
+ # The parameter is set just after the validation, since the allow_disable
+ # key isn't in the valuespec. Curiously, the validation does not fail
+ # even the allow_disable key is set before the validate_value...
+ rule["allow_disable"] = True
if new and clone_nr >= 0:
rules[clone_nr:clone_nr] = [ rule ]
Module: check_mk
Branch: master
Commit: de7cef8acd999755ffdbe4418df58f7fea89b0e3
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=de7cef8acd9997…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed Jun 21 13:49:46 2017 +0200
4870 FIX Fixed ineffective graph time range display option
Change-Id: I0382874116c5ec3135a94c9b72da9a8f8abd4af9
---
.werks/4870 | 16 ++++++++++++++++
web/plugins/views/painters.py | 4 +++-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/.werks/4870 b/.werks/4870
new file mode 100644
index 0000000..3bee8b3
--- /dev/null
+++ b/.werks/4870
@@ -0,0 +1,16 @@
+Title: Fixed ineffective graph time range display option
+Level: 1
+Component: metrics
+Class: fix
+Compatible: compat
+Edition: cee
+State: unknown
+Version: 1.5.0i1
+Date: 1497954949
+
+Starting point is having views with configured column
+{{Service Graphs with Timerange Previews}}. Then in
+{{Display options}} which modifies user specific options,
+chosen {{Graph Timerange}} had no effects on displayed graphs.
+The time range could be changed only with {{Set default time range}}
+which is a subset of {{Graph Timerange}}.
diff --git a/web/plugins/views/painters.py b/web/plugins/views/painters.py
index a2c98f8..afc0d87 100644
--- a/web/plugins/views/painters.py
+++ b/web/plugins/views/painters.py
@@ -92,7 +92,7 @@ from lib import *
multisite_painter_options["pnp_timerange"] = {
'valuespec' : Timerange(
- title = _("Graph Timerange"),
+ title = _("Graph time range"),
default_value = None,
include_time = True,
)
@@ -1002,9 +1002,11 @@ def paint_time_graph_cmk(row, cell, show_timeranges=False):
# a) the painter parameters configured in the view
# b) the painter options set per user and view
graph_render_options = cell.painter_parameters().copy()
+
options = painter_options.get_without_default("graph_render_options")
if options != None:
graph_render_options.update(options)
+ del graph_render_options["set_default_time_range"]
if html.is_mobile():
graph_render_options.update({