Piggyback configuration

Hi guys,

I’m trying to use the piggyback feature and have read the documentation https://checkmk.com/cms_piggyback.html, however, I don’t understand how to setup the piggyback host A to query host B to retrieve the CMK data from that agent.

Background is that host B is in an isolated network and host A is the bastion host that can be accessed by CMK. I can’t find any information on how to setup / configure host A to provide the CMK data of host B. Is there a config / agent or anything to use instead of the default CMK agent? What am I missing :slight_smile:

Running CMK 1.6.

Thanks for your help.

Cheers,
Thomas

One option is a small helper script on your host A that is only collecting the agent output data from host B and write it to a cache file (or retrieve it live).
This helper script only needs to add the piggyback line at the top and bottom.
Result should look like this.

<<<<hostnameB>>>>
<<<check_mk>>>
Version: ......
<<<<>>>>

This resulting text is then only outputted with the normal agent output from host A.
CMK then sees that it is data for host B and will display the services in your monitoring an the right host.

3 Likes

An addition to @andreas-doehler’s solution: You can write the collected data to a file in the directory

/var/lib/check_mk_agent/spool.

With the file name you setup how often the data is updated: e.g. 3600_data means that the data is rewritten every 3600 seconds.

Karl

3 Likes