Werk #16798: ups_test: Handle unknown time since last test

Component Checks & agents
Title ups_test: Handle unknown time since last test
Date Jun 17, 2024
Level Trivial Change
Class Bug Fix
Compatibility Compatible - no manual interaction needed
Checkmk versions & editions
2.4.0b1
Not yet released
Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)
2.3.0p7 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)

The time since the last battery test is calculated via the difference between the current uptime and the uptime when the test was initiated. This means the time cannot be determined if the uptime of the test initiation is larger than the current uptime.

Before, this lead to a

ValueError: Cannot render negative timespan

Now, the check will become UNKNOWN instead.

To the list of all Werks