Module: check_mk
Branch: master
Commit: 460ebc0534e90d92704936a88b9e38c467f6fba7
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=460ebc0534e90d…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Fri Mar 29 09:59:58 2019 +0100
k8s_selector: inventory plugin to show selectors
Change-Id: Iab0a82f7277fd1125e3a6c356557e99ccce8158e
---
cmk/gui/plugins/views/inventory.py | 3 +++
cmk/special_agents/agent_kubernetes.py | 5 ++++-
inventory/k8s_selector | 41 ++++++++++++++++++++++++++++++++++
3 files changed, 48 insertions(+), 1 deletion(-)
diff --git a/cmk/gui/plugins/views/inventory.py b/cmk/gui/plugins/views/inventory.py
index 8aa0629..100ed0d 100644
--- a/cmk/gui/plugins/views/inventory.py
+++ b/cmk/gui/plugins/views/inventory.py
@@ -1121,6 +1121,9 @@ inventory_displayhints.update({
".software.applications.kubernetes.service_info.type": {"title": _("Type")},
".software.applications.kubernetes.service_info.cluster_ip": {"title": _("Cluster IP")},
".software.applications.kubernetes.service_info.load_balancer_ip": {"title": _("Load Balancer IP")},
+ ".software.applications.kubernetes.selector.": {
+ "title": _("Selectors"),
+ },
".software.applications.citrix.": {"title": _("Citrix")},
".software.applications.citrix.controller.": {"title": _("Controller")},
".software.applications.citrix.controller.controller_version": {
diff --git a/cmk/special_agents/agent_kubernetes.py b/cmk/special_agents/agent_kubernetes.py
index aa93b47..122f601 100644
--- a/cmk/special_agents/agent_kubernetes.py
+++ b/cmk/special_agents/agent_kubernetes.py
@@ -290,7 +290,6 @@ class Service(Metadata):
def info(self):
return {
'type': self._type,
- 'selector': self._selector,
'cluster_ip': self._cluster_ip,
'load_balancer_ip': self._load_balancer_ip,
}
@@ -608,6 +607,9 @@ class ServiceList(K8sList[Service]):
def infos(self):
return {service.name: service.info for service in self}
+ def selector(self):
+ return {service.name: service.selector for service in self}
+
def ports(self):
return {service.name: service.ports for service in self}
@@ -1002,6 +1004,7 @@ class ApiData(object):
logging.info('Output service sections')
g = Group()
g.join('labels', self.services.labels())
+ g.join('k8s_selector', self.services.selector())
g.join('k8s_service_info', self.services.infos())
g.join('k8s_service_ports', self.services.ports())
return '\n'.join(g.output(piggyback_prefix="service_"))
diff --git a/inventory/k8s_selector b/inventory/k8s_selector
new file mode 100644
index 0000000..76e219f
--- /dev/null
+++ b/inventory/k8s_selector
@@ -0,0 +1,41 @@
+#!/usr/bin/env python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2019 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# tails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+
+def inv_k8s_selector(info, inventory_tree):
+ parsed = parse_k8s(info)
+
+ path = "software.applications.kubernetes.selector."
+ inv_node = inventory_tree.get_dict(path)
+
+ for key, value in sorted(parsed.iteritems()):
+ inv_node[key] = value
+
+
+inv_info['k8s_selector'] = {
+ 'inv_function': inv_k8s_selector,
+ 'includes': ['k8s.include'],
+}
Module: check_mk
Branch: master
Commit: 856b998f543450c2b239ff746f69b514ecd9e9b3
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=856b998f543450…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Mar 28 16:10:30 2019 +0100
Remove unused FILE_PATH global variable for .mk config files
Check_MK base config files could contain references to a global
variable FILE_PATH. This is an unused variable for a long time
now. It was replaced by FOLDER_PATH in the early days of WATO.
The FILE_PATH variable has now been cleaned up. If your
configuration files contain such a variable, you need to clean
it up or replace it with FOLDER_PATH.
Change-Id: I34f493ee5d8a3af1b762e10caa9b18cc9831b395
---
cmk/gui/watolib/rulesets.py | 1 -
cmk_base/config.py | 3 ---
2 files changed, 4 deletions(-)
diff --git a/cmk/gui/watolib/rulesets.py b/cmk/gui/watolib/rulesets.py
index 264b05f..6d3967f 100644
--- a/cmk/gui/watolib/rulesets.py
+++ b/cmk/gui/watolib/rulesets.py
@@ -78,7 +78,6 @@ class RulesetCollection(object):
"ALL_SERVICES": [""],
"NEGATE": NEGATE,
"FOLDER_PATH": folder.path(),
- "FILE_PATH": folder.path() + "/hosts.mk",
}
# Prepare empty rulesets so that rules.mk has something to
diff --git a/cmk_base/config.py b/cmk_base/config.py
index ec99a5c..b2ed2b8 100644
--- a/cmk_base/config.py
+++ b/cmk_base/config.py
@@ -201,7 +201,6 @@ def _perform_post_config_loading_actions():
def _load_config(with_conf_d, exclude_parents_mk):
helper_vars = {
- "FILE_PATH": None,
"FOLDER_PATH": None,
}
@@ -222,12 +221,10 @@ def _load_config(with_conf_d, exclude_parents_mk):
if _f.startswith(cmk.utils.paths.check_mk_config_dir + "/"):
_file_path = _f[len(cmk.utils.paths.check_mk_config_dir) + 1:]
global_dict.update({
- "FILE_PATH": _file_path,
"FOLDER_PATH": os.path.dirname(_file_path),
})
else:
global_dict.update({
- "FILE_PATH": None,
"FOLDER_PATH": None,
})
Module: check_mk
Branch: master
Commit: 182356f7a28577acd0b13280ab67f09be344c502
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=182356f7a28577…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Wed Mar 27 20:48:57 2019 +0100
check_http: move help text
CMK-1873
Change-Id: Id7254f5168f69970e136f96d66414bd4ccbc589a
---
cmk/gui/plugins/wato/active_checks.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/cmk/gui/plugins/wato/active_checks.py b/cmk/gui/plugins/wato/active_checks.py
index 64f8512..c72b3c1 100644
--- a/cmk/gui/plugins/wato/active_checks.py
+++ b/cmk/gui/plugins/wato/active_checks.py
@@ -1243,16 +1243,16 @@ class RulespecActiveChecksHttp(HostRulespec):
("cert", _("Check SSL Certificate Age"),
Dictionary(
title=_("Certificate Checking"),
+ help=_("Port defaults to 443. In this mode the URL"
+ " is not checked."),
elements=[
(
"cert_days",
Transform(
Tuple(
title=_("Age"),
- help=
- _("Minimum number of days a certificate has to be valid. "
- "Port defaults to 443. When this option is used the URL "
- "is not checked."),
+ help=_("Minimum number of days a certificate"
+ " has to be valid."),
elements=[
Integer(
title=_("Warning at or below"),