Dear CheckMK Community,
once again, I am in need for advice.
I created a local check with a cache lifetime of 24h.
The check monitors if all the letsencrypt certificates on a server are valid or due for renewal and restarts the webserver.
Strange output
The text
Cache generated X m ago, cache interval: 24 h, elapsed cache lifespan: X %
shows up in the long output of check plugin column, and the column “Cached agent data” is empty.
See attached screenshot for clarification.
My Service Output was
0 LetsEncrypt-Certs - All certs valid\nCERTNAME (X days valid)
I changed it to include a \n at the end, as I thought that would maybe mark the end of the long output.
Afterwards, it looked like this
0 LetsEncrypt-Certs - All certs valid\nCERTNAME (X days valid)\n
But the Cached-Text still shows up in the Long output of the service.
When clicking on the “Hamburger-Menu” next to the service, what would be expected is the info about the check being cached.
This service is based on cached agent data and cannot be rescheduled. Cache generated X m ago, cache interval: X m, elapsed cache lifespan: X%
This does not show up on the local check because checkmk seems to miss the information about the check being cached.
There is a folder for each server with the check plugin found in:
/omd/sites/SITENAME/tmp/check_mk/cache
When I grep through this cache with grep -i letsencrypt
it shows
cached(1612271295,86400) 0 LetsEncrypt-Certs - All certs valid\nCERTNAME (69 days valid)\n
I also tried executing check_mk_caching_agent | grep -i letsencrypt
on the server with letsencrypt and this also shows the cached output.
So I guess the caching is working correctly but the multiline output does not?
But when looking at the service (or searching for it via quicksearch) the “Last Checked” column is never reaching 24h.
I don’t really know if the caching is working or not because these different pieces of information lead me to different conclusions.
This is the first local check I wrote with cached agent data, did I miss something?
Thank you for taking the time to read and help.
Info:
CheckMK Enterprise 1.6.0p19 on Ubuntu 18.04.5 LTS
Monitored Servers with LetsEncrypt are (mostly) on WAN, a few or on the same network as the CheckMK Server.
Greetings,
Pixelpoint