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 |
|
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.