Monitoring of docker services
Configuration
A very good description can be found here:
Install the agent
You will need the mk_docker.py
agent plug-in, which you can find here: Setup > Agents > Other operating systems > Plugins
wget http://syslog.simmy.ch/monitoring2/check_mk/agents/plugins/mk_docker.py
Install the plug-in to the agent’s plug-in folder (usually /usr/lib/check_mk_agent/plugins
).
install -m 0755 mk_docker.py /usr/lib/check_mk_agent/plugins
create the config file
Create the configuration file /etc/check_mk/docker.cfg
on the Docker host. A template with detailed explanations can be found in the Checkmk directory ~/share/check_mk/agents/cfg_examples/docker.cfg
.
# Copyright (C) 2019 tribe29 GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.
# This is an exaple configuration file for the plugin
#
# mk_docker.py
#
# It is designed to give you an impression of available
# options. The specific choice in this file is a valid setup,
# but probably not suitable for your use case.
# If you intend to run the plugin with the default options,
# you do not need any configuration file at all.
# You must specify one section of the name DOCKER (additional sections are ignored).
[DOCKER]
# SELECTION OF AGENT SECTIONS (SERVICES) TO CREATE
# If some of the sections take too long to run, and you don't need them, you
# can disable them by specifying a comma separated list (Default: empty string
# - run all sections). To disable the sections <<<docker_node_disk_usage>>>
# and <<<docker_node_images>>>, for example, provide:
skip_sections: docker_node_disk_usage,docker_node_images
# You may skip any of the following sections:
# * docker_node_disk_usage: get df like info of disk usage (may take long)
# * docker_node_images: get detailed information on all images and containers
# (for HW/SW inventory)
# * docker_node_network: get network information
# The following sections send piggyback information to monitored containers:
# * docker_container_node_name: display nodes name on container
# * docker_container_status: container status/health according to docker health API
# * docker_container_labels: containers labels
# * docker_container_network: containers network configuration
# * docker_container_agent: retrieve information by running the
# check_mk_agent inside the container
# If no agent was installed on the container:
# * docker_container_mem: container memory stats
# * docker_container_cpu: container cpu utilization
# * docker_container_diskstat container disk stats
# CONTAINER ID
# You can choose what to use as the container identifier. This will
# affect the name used for the piggyback host corresponding to the
# container, as well as items for services created on the node for each
# container.
# By default, the identifier is assumed to be the first 12 characters
# of the container UUID. You can choose to use the full ID or the containers
# name instead. Allowed values are "short" (the default), "long" and "name".
container_id: name
# BASE URL
# By default we are trying to connect to the docker API engine
# via the unix socket:
base_url: unix://var/run/docker.sock
Settings in the GUI
In addition I created a folder with the name docker-services:
I had to add hosts with the names of the docker containers.
That's all.
No Comments