Description

Docker reports the CPU usage of a container like docker stats: 100 % per fully used CPU core. On a host with many cores a single container can show hundreds or thousands of percent, which breaks every threshold written for "total CPU in %". On Checkmk versions older than 2.5.0p12 the built-in service also shows a bogus "under high load for ... years" duration (Werk 20187).

This package adds the service Docker CPU utilization for Docker container hosts. It reports the utilization in percent of the available CPUs (always 0 to 100 %) and the number of CPU cores in use.

Features

  • Normalized CPU utilization per container, e.g. Total CPU: 1.48%, 1.07 of 72 CPUs in use
  • Metrics util (shown in the standard CPU graph) and docker_cpu_cores_used
  • Levels in the WebUI, with levels over an extended time period as default (WARN after 1 h 30 min, CRIT after 3 h at 90 %), so short peaks do not alarm
  • Works with the standard Docker data of mk_docker.py, no agent plug-in has to be rolled out
  • Optional agent plug-in for Linux and Windows (Agent Bakery rule) that also reports the container CPU limit
  • Counter resets after a container restart are ignored instead of producing negative values
  • The built-in "CPU utilization" service is not changed
  • Safe to install: no service is created until a discovery rule exists

Requirements

  • Checkmk 2.5.0 or newer
  • Docker hosts monitored with the Docker agent plug-in mk_docker.py (container hosts as piggyback hosts)

Notes

  • With the standard Docker data the CPU limit of a container is not known, the value is related to all CPUs of the Docker host. The optional agent plug-in also takes the limit into account.
  • Full documentation and changelog are included in the package (doc folder, in English).

Tested

Tested live on Checkmk 2.5.0p10 in a distributed setup with the standard Docker data on Linux Docker hosts. The optional agent plug-in was checked on a Linux Docker host up to the delivery of its data. The Windows variant has not been tested on a real Windows Docker host.


Deutsch

Docker meldet die CPU-Nutzung eines Containers wie docker stats: 100 % pro voll ausgelastetem CPU-Kern. Auf einem Host mit vielen Kernen kann ein einzelner Container hunderte oder tausende Prozent zeigen, wodurch alle Schwellwerte für "Gesamt-CPU in %" nicht mehr funktionieren. Bei Checkmk-Versionen vor 2.5.0p12 zeigt der eingebaute Service außerdem eine falsche Dauer "under high load for ... years" (Werk 20187).

Dieses Paket fügt den Service Docker CPU utilization für Docker-Container-Hosts hinzu. Er zeigt die Auslastung in Prozent der verfügbaren CPUs (immer 0 bis 100 %) und die Zahl der genutzten CPU-Kerne.

Funktionen

  • Normalisierte CPU-Auslastung pro Container, z. B. Total CPU: 1.48%, 1.07 of 72 CPUs in use
  • Metriken util (im Standard-CPU-Graphen sichtbar) und docker_cpu_cores_used
  • Schwellwerte in der WebUI, standardmäßig über einen Zeitraum (WARN nach 1 h 30 min, CRIT nach 3 h bei 90 %), kurze Lastspitzen alarmieren nicht
  • Arbeitet mit den Standard-Docker-Daten von mk_docker.py, es muss kein Agent-Plugin ausgerollt werden
  • Optionales Agent-Plugin für Linux und Windows (Agent-Bakery-Regel), das auch das CPU-Limit des Containers meldet
  • Zählerrücksetzungen nach einem Container-Neustart werden ignoriert, statt negative Werte zu erzeugen
  • Der eingebaute Service "CPU utilization" wird nicht verändert
  • Sicher zu installieren: Ohne Discovery-Regel wird kein Service angelegt

Voraussetzungen

  • Checkmk 2.5.0 oder neuer
  • Docker-Hosts, die mit dem Docker-Agent-Plugin mk_docker.py überwacht werden (Container-Hosts als Piggyback-Hosts)

Hinweise

  • Bei den Standard-Docker-Daten ist das CPU-Limit eines Containers nicht bekannt, der Wert bezieht sich auf alle CPUs des Docker-Hosts. Das optionale Agent-Plugin berücksichtigt auch das Limit.
  • Die vollständige Dokumentation und das Changelog sind im Paket enthalten (Ordner doc, auf Englisch).

Getestet

Live getestet auf Checkmk 2.5.0p10 in einer verteilten Umgebung mit den Standard-Docker-Daten auf Linux-Docker-Hosts. Das optionale Agent-Plugin wurde auf einem Linux-Docker-Host bis zur Lieferung seiner Daten geprüft. Die Windows-Variante wurde auf keinem echten Windows-Docker-Host getestet.

Version 1.2.1
Latest version

Uploaded on: 2 Oct 2026

Downloads: 0

Built on Checkmk version: cmk-mkp-tool 3.0.0

Minimum Checkmk version required: 2.5.0

MKP MD5 hash: de37b4bb798c5ea05ffb31062a519e9f