Module: check_mk
Branch: master
Commit: 51da0046fba49d44c99ded7a4c8bde263f0d30f3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=51da0046fba49d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Dec 7 13:41:26 2017 +0100
AC Test helper usage: Only report too low usage when user increased the helpers
Change-Id: I267a35860c97bcf4111ac9dc401c349087306ab8
---
web/plugins/wato/ac_tests.py | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/web/plugins/wato/ac_tests.py b/web/plugins/wato/ac_tests.py
index 16b00c7..f20d7dc 100644
--- a/web/plugins/wato/ac_tests.py
+++ b/web/plugins/wato/ac_tests.py
@@ -506,7 +506,27 @@ class ACTestCheckMKHelperUsage(ACTest):
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))
- if helper_usage_perc < 50:
+ default_values = watolib.ConfigDomain().get_all_default_globals()
+ def get_effective_global_setting(varname):
+ global_settings = watolib.load_configuration_settings()
+
+ if watolib.is_wato_slave_site():
+ current_settings =
watolib.load_configuration_settings(site_specific=True)
+ else:
+ sites = watolib.SiteManagement.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
+
+ # 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."))