Module: check_mk
Branch: master
Commit: 57423dff94deb0e3e264460caae88c9786a28a7f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=57423dff94deb0…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Mon Apr 1 10:01:11 2019 +0200
check_http: fix ambiguous title
CMK-1873
Change-Id: Ibe064ec934fe45652c078879a9aede2551d9b4d3
---
cmk/gui/plugins/wato/active_checks.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmk/gui/plugins/wato/active_checks.py b/cmk/gui/plugins/wato/active_checks.py
index c5cc2c4..6ac5d8f 100644
--- a/cmk/gui/plugins/wato/active_checks.py
+++ b/cmk/gui/plugins/wato/active_checks.py
@@ -1013,7 +1013,7 @@ class RulespecActiveChecksHttp(HostRulespec):
elements=[
("name",
TextUnicode(
- title=_("Name"),
+ title=_("Service name"),
help=_(
"Will be used in the service description. If the name starts with "
"a caret (<tt>^</tt>), the service description will not be prefixed with either "
Module: check_mk
Branch: master
Commit: f3eec1e2acfba3faa8ba966c5dfb4196454bee87
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f3eec1e2acfba3…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Mon Apr 1 10:59:30 2019 +0200
7386 FIX docker_node_disk_usage: Handle busy docker daemon
If the docker daemon cannot get the disk usage info, the corresponding services
will become stale without the Check_MK Discovery service going into a WARNING
state.
This can happen if you are calling the mk_docker plugin from different Sites.
Consider configuring asynchronous plugin execution in this case.
CMK-1786
Change-Id: Ic869f486e1a3a63efd607d8dc4254638596128b3
---
.werks/7386 | 14 ++++++++++++++
agents/plugins/mk_docker.py | 9 +++++++--
tests/unit/plugins/test_mk_docker.py | 2 +-
3 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/.werks/7386 b/.werks/7386
new file mode 100644
index 0000000..6fa4e7e
--- /dev/null
+++ b/.werks/7386
@@ -0,0 +1,14 @@
+Title: docker_node_disk_usage: Handle busy docker daemon
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1554108850
+Class: fix
+
+If the docker daemon cannot get the disk usage info, the corresponding services
+will become stale without the Check_MK Discovery service going into a WARNING
+state.
+This can happen if you are calling the mk_docker plugin from different Sites.
+Consider configuring asynchronous plugin execution in this case.
diff --git a/agents/plugins/mk_docker.py b/agents/plugins/mk_docker.py
index d533420..dbe424e 100755
--- a/agents/plugins/mk_docker.py
+++ b/agents/plugins/mk_docker.py
@@ -327,9 +327,14 @@ def section_node_info(client, _config):
@skippable
def section_node_disk_usage(client, _config):
'''docker system df'''
- data = client.df()
- LOGGER.debug(data)
section = Section('node_disk_usage')
+ try:
+ data = client.df()
+ except () if DEBUG else docker.errors.APIError as exc:
+ section.write()
+ LOGGER.exception(exc)
+ return
+ LOGGER.debug(data)
def get_row(type_, instances, is_inactive, key='Size'):
inactive = [i for i in instances if is_inactive(i)]
diff --git a/tests/unit/plugins/test_mk_docker.py b/tests/unit/plugins/test_mk_docker.py
index e53371a..f281791 100644
--- a/tests/unit/plugins/test_mk_docker.py
+++ b/tests/unit/plugins/test_mk_docker.py
@@ -11,7 +11,7 @@ sys.path.insert(0, os.path.join(cmk_path(), 'agents', 'plugins'))
import mk_docker # pylint: disable=import-error,wrong-import-position
PLUGIN_CHECKSUMS = {
- '0.1': 'f43bbe8ce8f19763d53ffa116988fa2d',
+ '0.1': 'c00f1771660172e8b1b9cc225c2930ab',
}
Module: check_mk
Branch: master
Commit: 95067fbc512018595dfba6b1d812464949e90aac
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=95067fbc512018…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Fri Mar 29 14:18:19 2019 +0100
k8s_assigned_pods: show pods of services in the HW/SW inventory
Change-Id: I873a5127afb7f5228b43d8b098de7a772bb582f1
---
cmk/gui/plugins/views/inventory.py | 4 ++++
cmk/special_agents/agent_kubernetes.py | 6 +++++
inventory/k8s_assigned_pods | 42 ++++++++++++++++++++++++++++++++++
3 files changed, 52 insertions(+)
diff --git a/cmk/gui/plugins/views/inventory.py b/cmk/gui/plugins/views/inventory.py
index 100ed0d..4165f92 100644
--- a/cmk/gui/plugins/views/inventory.py
+++ b/cmk/gui/plugins/views/inventory.py
@@ -1124,6 +1124,10 @@ inventory_displayhints.update({
".software.applications.kubernetes.selector.": {
"title": _("Selectors"),
},
+ ".software.applications.kubernetes.assigned_pods:": {
+ "title": _("Pods"),
+ },
+ ".software.applications.kubernetes.assigned_pods:*.name": {"title": _("Name")},
".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 01b995b..036c08d 100644
--- a/cmk/special_agents/agent_kubernetes.py
+++ b/cmk/special_agents/agent_kubernetes.py
@@ -1033,6 +1033,12 @@ class ApiData(object):
g.join('k8s_selector', self.services.selector())
g.join('k8s_service_info', self.services.infos())
g.join('k8s_service_ports', self.services.ports())
+ pod_names = {
+ service_name: {
+ 'names': [pod.name for pod in pods]
+ } for service_name, pods in self.pods.group_by(self.services.selector()).iteritems()
+ }
+ g.join('k8s_assigned_pods', pod_names)
return '\n'.join(g.output(piggyback_prefix="service_"))
def deployment_sections(self):
diff --git a/inventory/k8s_assigned_pods b/inventory/k8s_assigned_pods
new file mode 100644
index 0000000..3d9cdc0
--- /dev/null
+++ b/inventory/k8s_assigned_pods
@@ -0,0 +1,42 @@
+#!/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_assigned_pods(info, _inventory_tree, status_data_tree):
+ parsed = parse_k8s(info)
+ path = "software.applications.kubernetes.assigned_pods:"
+ status_node = status_data_tree.get_list(path)
+
+ for pod_name in sorted(parsed['names']):
+ status_node.append({
+ 'name': pod_name,
+ })
+
+
+inv_info['k8s_assigned_pods'] = {
+ 'inv_function': inv_k8s_assigned_pods,
+ 'includes': ['k8s.include'],
+}
\ No newline at end of file