Module: check_mk
Branch: master
Commit: b686d5e963e28ec09a9985ba22722d7980c53d6d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b686d5e963e28e…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Aug 29 15:11:20 2018 +0200
Add AC test for alert handlers being configured to handle each check execution
Change-Id: Ifc8cfcb159c1b4baf4182c26a392d8338ce833f5
---
cmk/gui/plugins/wato/ac_tests.py | 66 +++++++++++++++++++++++++++++-----------
1 file changed, 48 insertions(+), 18 deletions(-)
diff --git a/cmk/gui/plugins/wato/ac_tests.py b/cmk/gui/plugins/wato/ac_tests.py
index 2e53182..d170205 100644
--- a/cmk/gui/plugins/wato/ac_tests.py
+++ b/cmk/gui/plugins/wato/ac_tests.py
@@ -427,6 +427,26 @@ class ACMicrocoreTest(object):
return version.startswith("Check_MK")
+ def _get_effective_global_setting(self, varname):
+ global_settings = watolib.load_configuration_settings()
+ default_values = watolib.ConfigDomain().get_all_default_globals()
+
+ if watolib.is_wato_slave_site():
+ current_settings = watolib.load_configuration_settings(site_specific=True)
+ else:
+ sites = watolib.SiteManagementFactory.factory().load_sites()
+ current_settings = sites[config.omd_site()].get("globals", {})
+
+ if varname in current_settings:
+ value = current_settings[varname]
+ elif varname in global_settings:
+ value = global_settings[varname]
+ else:
+ value = default_values[varname]
+
+ return value
+
+
class ACApacheTest(object):
"""Abstract base class for apache related tests"""
@@ -643,29 +663,39 @@ class ACTestCheckMKHelperUsage(ACTest, ACMicrocoreTest):
yield cls(_("The current Check_MK helper usage is %.2f%%. The Check_MK services have an "
"average check latency of %.3fs.") % (helper_usage_perc, check_latecy_cmk))
+ # Only report this as warning in case the user increased the default helper configuration
default_values = watolib.ConfigDomain().get_all_default_globals()
- def get_effective_global_setting(varname):
- global_settings = watolib.load_configuration_settings()
+ if self._get_effective_global_setting("cmc_cmk_helpers") > default_values["cmc_cmk_helpers"] and helper_usage_perc < 50:
+ yield ACResultWARN(_("The helper usage is below 50%, you may decrease the number of "
+ "Check_MK helpers to reduce the memory consumption."))
- if watolib.is_wato_slave_site():
- current_settings = watolib.load_configuration_settings(site_specific=True)
- else:
- sites = watolib.SiteManagementFactory.factory().load_sites()
- current_settings = sites[config.omd_site()].get("globals", {})
- if varname in current_settings:
- value = current_settings[varname]
- elif varname in global_settings:
- value = global_settings[varname]
- else:
- value = default_values[varname]
- return value
+class ACTestAlertHandlerEventTypes(ACTest, ACMicrocoreTest):
+ def category(self):
+ return ACTestCategories.performance
- # Only report this as warning in case the user increased the default helper configuration
- if get_effective_global_setting("cmc_cmk_helpers") > default_values["cmc_cmk_helpers"] and helper_usage_perc < 50:
- yield ACResultWARN(_("The helper usage is below 50%, you may decrease the number of "
- "Check_MK helpers to reduce the memory consumption."))
+
+ def title(self):
+ return _("Alert handler: Don't handle all check executions")
+
+
+ def help(self):
+ return _("In general it will result in a significantly increased load when alert handlers are "
+ "configured to handle all check executions. It is highly recommended to "
+ "<a href=\"wato.py?mode=edit_configvar&varname=alert_handler_event_types\">disable "
+ "this</a> in most cases.")
+
+
+ def is_relevant(self):
+ return self._uses_microcore()
+
+
+ def execute(self):
+ if "checkresult" in self._get_effective_global_setting("alert_handler_event_types"):
+ yield ACResultCRIT(_("Alert handler are configured to handle all check execution."))
+ else:
+ yield ACResultOK(_("Alert handlers will handle state changes."))
Module: check_mk
Branch: master
Commit: abb20a16e94602dfe6711ed83dafca75da3a50ae
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=abb20a16e94602…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Aug 29 14:36:29 2018 +0200
6511 FIX Global Settings: Custom localizations fixed possible exception when language alias contains non-ascii characters
An exception could occur when using a localized GUI and a language which uses non-ascii characters
in it's alias file (local/share/check_mk/locale/[lang]/alias).
Change-Id: Ic6254e85dbac48f7f1c2a62710196efc3a87c78c
---
.werks/6511 | 12 ++++++++++++
cmk/gui/i18n.py | 8 ++++----
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/.werks/6511 b/.werks/6511
new file mode 100644
index 0000000..4cc4cc6
--- /dev/null
+++ b/.werks/6511
@@ -0,0 +1,12 @@
+Title: Global Settings: Custom localizations fixed possible exception when language alias contains non-ascii characters
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1535531405
+
+An exception could occur when using a localized GUI and a language which uses non-ascii characters
+in it's alias file (local/share/check_mk/locale/[lang]/alias).
diff --git a/cmk/gui/i18n.py b/cmk/gui/i18n.py
index b0318d8..c5adef9 100644
--- a/cmk/gui/i18n.py
+++ b/cmk/gui/i18n.py
@@ -54,7 +54,7 @@ Translation = NamedTuple("Translation", [
_translation = None # type: Optional[Translation]
def _(message):
- # type: (str) -> unicode
+ # type: (str) -> Text
if not _translation:
return unicode(message)
else:
@@ -75,18 +75,18 @@ def _get_language_dirs():
def get_language_alias(lang):
- # type: (str) -> unicode
+ # type: (str) -> Text
alias = lang
for lang_dir in _get_language_dirs():
try:
alias = open('%s/%s/alias' % (lang_dir, lang), 'r').read().strip()
except (OSError, IOError):
pass
- return alias
+ return alias.decode("utf-8")
def get_languages():
- # type: () -> List[Tuple[str, unicode]]
+ # type: () -> List[Tuple[str, Text]]
# Add the hard coded english language to the language list
# It must be choosable even if the administrator changed the default
# language to a custom value
Module: check_mk
Branch: master
Commit: 6dc21814dec51478e6ec021eee442c11d3c8add8
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6dc21814dec514…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Wed Aug 29 10:11:16 2018 +0200
6471 FIX New Theme: Updated fixes
This werk includes some minor fixes for:
- Missing highlighting of ineffective rules
- Too small arrow WATO > Hosts for folder order
- White title of folder if the folder is locked
Change-Id: I7d2cecc8fbe1c22ececa17394998f1ee9be27732
---
.werks/6471 | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/.werks/6471 b/.werks/6471
new file mode 100644
index 0000000..f59ff5a
--- /dev/null
+++ b/.werks/6471
@@ -0,0 +1,13 @@
+Title: New Theme: Updated fixes
+Level: 1
+Component: multisite
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1535530091
+Class: fix
+
+This werk includes some minor fixes for:
+- Missing highlighting of ineffective rules
+- Too small arrow WATO > Hosts for folder order
+- White title of folder if the folder is locked