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

Werk #18762: ups_capacity: Fix crash on negative remaining battery time

Component Checks & agents
Title ups_capacity: Fix crash on negative remaining battery time
Date Aug 18, 2026
Level Trivial Change
Class Bug Fix
Compatibility Compatible - no manual interaction needed
Checkmk versions & editions
3.0.0b1
Not yet released
Checkmk Community, Checkmk Pro, Checkmk Ultimate, Checkmk Cloud, Checkmk Ultimate MT
2.5.0p13
Not yet released
Checkmk Community, Checkmk Pro, Checkmk Ultimate, Checkmk Cloud, Checkmk Ultimate MT
2.4.0p36 Checkmk Community, Checkmk Pro, Checkmk Ultimate, Checkmk Cloud, Checkmk Ultimate MT

This affects users monitoring UPS devices via SNMP whose device reports a negative value for the remaining battery time (upsEstimatedMinutesRemaining, OID .1.3.6.1.2.1.33.1.2.3.0). While that value is specified as non-negative, some devices report a negative value when they cannot determine the remaining time.

Previously the Battery capacity service crashed in this case with:

File ".../cmk/agent_based/v1/render.py", line 76, in _gen_timespan_chunks
    raise ValueError("Cannot render negative timespan")

The service now goes UNKNOWN and reports the invalid value instead of crashing, for example:

Device reported an invalid remaining battery time (-60 seconds)

No battery_seconds_remaining metric is reported in this case. The battery charge level and the time running on battery are not affected and are still reported as before.

To the list of all Werks