Writing piggyback data per script

Hi,

is it possibility to write piggyback data directly into ~/tmp/check_mk/piggyback/HostA/HostB via a script? I did it, but Checkmk complains about it with the following message:

Piggyback file ‘/omd/sites/monitoring/tmp/check_mk/piggyback/HostB/HostA’ is outdated (Source ‘HostA’ not sending piggyback data). Skip processing.


ambre

There is a second file (timestamp file) for the host that provides the data.
This file is located inside “~/tmp/check_mk/piggyback_sources/”.
You need to touch this file every time you write data in your piggyback file.

1 Like

Manually I put piggyback data into “~/tmp/check_mk/piggyback/HostA/HostB”. And I also touched file “~/tmp/check_mk/piggyback_sources/HostB” manually. But the touched file in “piggyback_source” directory is removed by Checkmk. Looks like Checkmk is removing files in this directory which are manually created for hosts which actually do not send piggyback data.

I assume you also monitor you checkmk server and have the agent installed. If so, there’s also a spool directory and the agent delivers every file in that directory together with its regular agent output.

Just place your piggyback file below /var/lib/check_mk_agent/spool and wrap it in the piggyback header like so:

<<<<HostA>>>>
(data for HostA here)
<<<<>>>>

The piggyback source will then be the checkmk server.

This is way easier than fiddling around with the internals of checkmk and its behaviour with regard to the piggyback directory.

Thanks Dirk. I will try this approach.

Sorry for the late response.

1 Like