Fix checks using waitmax
and run_cached
in Linux agent
#619
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
andwaitmax
in some agent sections is causing this. On servers with thetimeout
binary,waitmax
is defined as a function callingtimeout
In therun_cached
function a subshell is started and thewaitmax
function is not known in this context. If there is nowaitmax
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 thewaitmax
function, allowing it to be callable in the subshell started in therun_cached
function.Proposed changes
This MR reintroduces the missing export.