Module: check_mk
Branch: master
Commit: f15226dfdad483003f29f80962a450e22cc4187c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f15226dfdad483…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Tue Oct 9 16:20:39 2018 +0200
6412 FIX mk_docker_container_piggybacked: don't try to execute the check_mk_agent
inside a container if no bash is available
If bash is not available in a docker container docker reports the error on stdout.
The mk_docker_container_piggybacked plugin misinterpreted the error as an
available check_mk_agent inside of the container.
Affected hosts using the mk_docker_container_piggybacked plugin have to update
the plugin to the new version to avoid this behaviour.
Change-Id: If851fe33dea6cb861feb9bf416416e0ac802568d
---
.werks/6412 | 16 ++++++++++++++++
agents/plugins/mk_docker_container_piggybacked | 2 +-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/.werks/6412 b/.werks/6412
new file mode 100644
index 0000000..464e282
--- /dev/null
+++ b/.werks/6412
@@ -0,0 +1,16 @@
+Title: mk_docker_container_piggybacked: don't try to execute the check_mk_agent
inside a container if no bash is available
+Level: 1
+Component: checks
+Class: fix
+Compatible: incomp
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1539094056
+
+If bash is not available in a docker container docker reports the error on stdout.
+The mk_docker_container_piggybacked plugin misinterpreted the error as an
+available check_mk_agent inside of the container.
+
+Affected hosts using the mk_docker_container_piggybacked plugin have to update
+the plugin to the new version to avoid this behaviour.
diff --git a/agents/plugins/mk_docker_container_piggybacked
b/agents/plugins/mk_docker_container_piggybacked
index 5d8ca3e..36cf98c 100755
--- a/agents/plugins/mk_docker_container_piggybacked
+++ b/agents/plugins/mk_docker_container_piggybacked
@@ -42,7 +42,7 @@ if type docker > /dev/null 2>&1; then
# the container.
# Once it comes to plugins and custom configuration the user needs to use
# a little more complex setup. Have a look at the documentation.
- AGENT_PATH=$(docker container exec "$CONTAINER_ID" bash -c
"type check_mk_agent" 2>/dev/null)
+ AGENT_PATH=$(docker container exec "$CONTAINER_ID" bash -c
"type check_mk_agent" 2>/dev/null) || AGENT_PATH=
if [ -n "$AGENT_PATH" ]; then
docker container exec --env "REMOTE=$REMOTE"
"$CONTAINER_ID" check_mk_agent
elif docker container exec "$CONTAINER_ID" which bash >/dev/null
2>&1; then