Module: check_mk
Branch: master
Commit: 8c3e368ea336e09766855c68f7c232680b40f333
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8c3e368ea336e0…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Fri Apr 6 17:13:56 2018 +0200
Linux agent: Fetch information about docker container status
Change-Id: I77c5cf011897136864369456c55af7a27d5cfee7
---
agents/check_mk_agent.linux | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index 4fcb74f..ed1f384 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -976,6 +976,14 @@ if type docker > /dev/null 2>&1 ; then
echo "[[[containers]]]"
docker container ls --all --format "{{json .}}"
+ # For the container status, we want information about *all* containers
+ for CONTAINER_ID in $(docker container ls -q --all); do
+ echo "<<<<$CONTAINER_ID>>>>"
+ echo "<<<docker_container_status>>>"
+ docker inspect $CONTAINER_ID --format='{{json .State}}'
+ echo "<<<<>>>>"
+ done
+
for CONTAINER_ID in $(docker container ls -q); do
echo "<<<<$CONTAINER_ID>>>>"