Help understanding piggyback services

(cmk version: 2.0.0p19)
I want hostA to report data on hostB. So on hostA (a linux host) I put a script in /usr/lib/check_mk_agent/local/ that outputs data for hostB. I tried two formats:

<<<<hostB>>>>
0 omega_record_state record_state=ON
<<<<>>>>

and

<<<<hostB>>>>
<<<omega_record_state >>>
record_state ON
<<<<>>>>

The data shows up on the checkmk server in the file tmp/check_mk/piggyback/hostB/hostA as expected, but I don’t see any new services for hostB in service discovery. I do however, see a discovered host label “cmk/piggyback_source_hostA:yes”

What else do I have to do for this piggyback data to show up as a service “omega_record_state”?

Did you configure Host B to expect Piggyback data?

Not explicitly; I’ve left it as the default. The host configuration page reads " Use piggyback data from other hosts if present (Default value)"

1 Like

Try it like this:

<<<<hostB>>>>
<<<local>>>
0 omega_record_state record_state=ON
<<<<>>>>

Just add the local after the host.
I’ve had the same problem and it works like this.

2 Likes

Just add the local after the host

Thanks for the suggestion. I tried it, and the “local” line now shows up in the piggyback file:

$ cat hostA
<<<local:cached(1645649196,90)>>>
0 omega_record_state record_state=ON

but I don’t see a different result in the service scan.

EDIT: Adding the “local” line apparently also causes a crash in the Check_mk_discovery check, with error:

ValueError (Invalid line in agent section <<<local>>>. Reason: Received wrong format of local check output. Please read the documentation regarding the correct format: https://docs.checkmk.com/2.0.0/de/localchecks.html  First offending line: "0 omega_record_state record_state=1")

The format of the local line is a little bit wrong.
change your

to

0 omega_record_state - record_state=ON

As your local line has no performance data you need to insert this dash instead of the performance data.

2 Likes

@teridon you can mark @Man-in-Black as solution as this was only a missing dash here :wink:

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.