Catch up on the latest product updates, best practices, and expert insights from the Checkmk Conference #12 – Watch the livestream recordings now

Werk #18020: docker_container_status_health: fix check when health logs are empty

Component Checks & agents
Title docker_container_status_health: fix check when health logs are empty
Date May 6, 2025
Level Trivial Change
Class Bug Fix
Compatibility Compatible - no manual interaction needed
Checkmk versions & editions
2.5.0b1 Checkmk Community, Checkmk Pro, Checkmk Ultimate, Checkmk Cloud, Checkmk Ultimate MT
2.4.0p1 Checkmk Community, Checkmk Pro, Checkmk Ultimate, Checkmk Cloud, Checkmk Ultimate MT
2.3.0p33 Checkmk Community, Checkmk Pro, Checkmk Ultimate, Checkmk Ultimate MT

The check plugin crashed with the error

  File "/omd/sites/site_name/lib/python3/cmk/base/plugins/agent_based/docker_container_status.py", line 183, in check_docker_container_status_health
    last_log = health.get("Log", [{}])[-1]

This happened because the Log field in Docker's health check status can be an empty list ("Log": []) when a health check is defined but has not yet produced any results - this can typically occur during the initial startup period.

To the list of all Werks