checkmk
checkmk copied to clipboard
Fix checks using `waitmax` and `run_cached` in Linux agent
General information
Since checkmk 2.2, some checks (like chrony
) are not returning any data and are presumed missing/vanished. This is due to a regression.
Bug reports
checkmk 2.2.0p7 installed on Debian 12 checkmk Linux agent 2.2.0p7, over SSH, on Debian 12 (but other Linux distributions are affected.) chrony on the monitored servers
There is no step to reproduce the bug, it appears immediately.
The use of both run_cached
and waitmax
in some agent sections is causing this. On servers with the timeout
binary, waitmax
is defined as a function calling timeout
In the run_cached
function a subshell is started and the waitmax
function is not known in this context. If there is no waitmax
binary on the system, the check silently fails.
In the 2.1 version of the agent, there was export -f waitmax
just after the definition of the waitmax
function, allowing it to be callable in the subshell started in the run_cached
function.
Proposed changes
This MR reintroduces the missing export.
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅
recheck
I have read the CLA Document and I hereby sign the CLA or my organization already has a signed CLA.