Schedule datasource execution

Hello all,

I have a server configured both the checkmk agent and special agent. With the datasource program I get a huge amount of data by a REST API, which will be piggyback data for other hosts. For that reason, I want to run the datasource program only every few hours, but the normal agent should be refreshed as usual (60sec). Is this possible?


I don’t think it is possible in this way. But one suggestions looks like this.
Create a dummy host for this special agent and set the check interval to the value you want.
As you said the data is piggybacked then it should be no problem if it is not a real host object.
Keep in mind that you need to set the rule “Maximum age for piggyback files” to a value suitable for your system then.

I wrote some special agent for VMware VSAN where I stumpled into that problem and did not find any builtin solution. Querying their API might take some minutes on large clusters and returns huge amount of data. So I built some self caching stuff into the agent that saves output in ~/tmp for subsequent use. It just returns that cache if within query interval, which is configurable in WATO. The package is currently uploaded to checkmk exchange, but still under review. Once accepted, you might have a look.


1 Like

That was also my first thought and I did it this way now.
But I have a strange behavior: Wenn doing a discovery or service execution on commandline (cmk -vI or cmk -nvp) then the piggyback data is saved correct with header <<<servicename:sep(9):cached(1619812237,5670)>>>, when doing a check on the GUI (Check_MK or Check_MK inventory) then the data is saved with <<<servicename:sep(9):cached(1619812192,90). The check interval is configured to 63 Minutes.
This is why all checks are stale after one and a half minute. Do you know which service runs the datasource checks?

I expect your 63min check interval to be set on the host that does the query and not on the hosts receiving piggyback. In that case the latter ones will go stale if their check interval is shorter. So your datasource program should be run on normal interval and return cached data if it is not older than 63mins.
I know this is far away from any optimal solution. Maybe this issue could be something for a feature request, since slow APIs seem to get more and more.


1 Like

Hi Tom,
yes the check interval is scheduled on the Host with the API. I don’t like to write my own caching mechanism, due to the internal caching of checkmk. The strange thing is: Everythings works like a charm when manually run on the commandline (Correct cache time in piggyback file header), but when run automatically by Checkmk or manually on the GUI then the piggyback cache header is wrong…