Module: check_mk
Branch: master
Commit: 5dd361e4eac04cc84da7f7ad179f689e6f7f66ae
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5dd361e4eac04c…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Thu Oct 22 16:35:50 2015 +0200
added function to query the effective service level from a check
the effective service level is the service level for that service if one is configured, otherwise
the one of the host.
---
modules/check_mk_base.py | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index 762aa9d..dd6a756 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -2253,6 +2253,20 @@ def check_timeperiod(timeperiod):
return timeperiod not in g_inactive_timerperiods
+# retrive the service level that applies to the calling check.
+def get_effective_service_level():
+ service_levels = service_extra_conf(g_hostname, g_service_description,
+ service_service_levels)
+
+ if service_levels:
+ return service_levels[0]
+ else:
+ service_levels = host_extra_conf(g_hostname, host_service_levels)
+ if service_levels:
+ return service_levels[0]
+ return 0
+
+
#.
# .--Aggregation---------------------------------------------------------.
# | _ _ _ |
Module: check_mk
Branch: master
Commit: df9ea24fda8c4a088a2f31f5a0c99934dd264f5d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=df9ea24fda8c4a…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Oct 22 14:27:44 2015 +0200
Put service level information into packed configuration
---
modules/check_mk.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 1bab85b..09d6dea 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -3510,7 +3510,10 @@ def get_precompiled_check_parameters(hostname, item, params, check_type):
# use those files, so that changes in the actual config do not harm
# the running system.
-derived_config_variable_names = [ "hosttags" ]
+# Make service levels available during check execution
+service_service_levels = extra_service_conf.get("_ec_sl", [])
+host_service_levels = extra_host_conf.get("_ec_sl", [])
+derived_config_variable_names = [ "hosttags", "service_service_levels", "host_service_levels" ]
# These variables are part of the Check_MK configuration, but are not needed
# by the Check_MK keepalive mode, so exclude them from the packed config
Module: check_mk
Branch: master
Commit: 4ac975e263b1ad7b344558f85acde22fb982f040
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4ac975e263b1ad…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Oct 22 13:45:27 2015 +0200
Updated bug entries #2381
---
.bugs/2381 | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/.bugs/2381 b/.bugs/2381
new file mode 100644
index 0000000..5ad34d5
--- /dev/null
+++ b/.bugs/2381
@@ -0,0 +1,11 @@
+Title: Remove service_aggregations
+Component: core
+State: open
+Date: 2015-10-22 13:44:00
+Targetversion: future
+Class: todo
+
+We should finally remove this obscure feature. First step is to let the code
+still live, but fail with an error if it is used and provide a setting where
+it can be reenabled. That way users are aware that they need to find another
+solution.