Werk #18149: systemd_units: Don't crash if a processes consumes terabytes of memory

Component Checks & agents
Title systemd_units: Don't crash if a processes consumes terabytes of memory
Date Aug 5, 2025
Level Trivial Change
Class Bug Fix
Compatibility Compatible - no manual interaction needed
Checkmk versions & editions
2.5.0b1
Not yet released
Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)
2.4.0p10 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)

Previously, if a single process used more than a terabyte of data, the following exception could occur:

File "/omd/sites/heute/lib/python3/cmk/plugins/collection/agent_based/systemd_units.py
    return cls(int(float(value) * {\"B\": 1, \"K\": 1024, \"M\": 1024**2, \"G\": 1024**3}[unit]))
KeyError: ''

This has been fixed. Thank you, Andy Wettstein, for this contribution.

To the list of all Werks