Skip to content
Permalink
Browse files

10027 Install Checkmk agent in Checkmk docker containers

To be able to monitor Checkmk containers properly we now install the agent
by default.

Change-Id: Idb0b26fca06d3de06684d555b53e1316730b2cec
  • Loading branch information...
LarsMichelsen committed Sep 5, 2019
1 parent 49a27e6 commit 55d8103eaab8bb9eff81bf7a024a6a8bdb08e7a8
Showing with 27 additions and 1 deletion.
  1. +12 −0 .werks/10027
  2. +2 −0 docker/Dockerfile
  3. +3 −0 docker/docker-entrypoint.sh
  4. +10 −1 tests/docker/test_docker.py
@@ -0,0 +1,12 @@
Title: Install Checkmk agent in Checkmk docker containern
Level: 1
Component: packages
Class: feature
Compatible: compat
Edition: cre
State: unknown
Version: 1.7.0i1
Date: 1567682823

To be able to monitor Checkmk containers properly we now install the agent
by default.
@@ -45,6 +45,7 @@ RUN set -e \
openssh-client \
iputils-ping \
dpkg-sig \
net-tools \
$(cat needed-packages) \
&& apt-get clean \
&& rm /usr/sbin/policy-rc.d \
@@ -79,6 +80,7 @@ RUN set -e \
fi \
&& dpkg-sig --verify "${PKG_FILE}" \
&& dpkg -i "${PKG_FILE}" \
&& dpkg -i "/omd/versions/default/share/check_mk/agents/check-mk-agent_${CMK_VERSION}-1_all.deb" \
&& rm -f -- *.deb *.gpg needed-packages \
&& apt-get clean \
&& rm /usr/sbin/policy-rc.d \
@@ -104,6 +104,9 @@ if [ -n "$1" ]; then
exec "$@"
fi

echo "### STARTING XINETD"
service xinetd start

echo "### STARTING SITE"
exec_hook pre-start
omd start "$CMK_SITE_ID"
@@ -31,7 +31,7 @@
import os
import subprocess
import pytest # type: ignore
import docker
import docker # type: ignore

import testlib

@@ -323,6 +323,15 @@ def test_http_access(request, client):
["curl", "-D", "-", "http://127.0.0.1:5000/cmk/check_mk/login.py?_origtarget=index.py"])[-1]


def test_container_agent(request, client):
c = _start(request, client)
# Is the agent installed and executable?
assert c.exec_run(["check_mk_agent"])[-1].startswith("<<<check_mk>>>\n")

# Check whether or not the agent port is opened
assert ":::6556" in c.exec_run(["netstat", "-tln"])[-1]


def test_update(request, client, version):
container_name = "%s-monitoring" % branch_name

0 comments on commit 55d8103

Please sign in to comment.
You can’t perform that action at this time.