Local check piggyback format files

Hello, I would like to build a local check on a remote server and attach that local service to a “virtual” host via piggyback. That local check should run over several servers (checkmk agent) as It’s clustered and I don’t want that service to belongs to a physical host but I would like that it belongs to a virtual clustername host example “ClusterFoo”.

I plan to pass that data via piggyback method.
So for example I will:

  1. create a host “ClusterFoo” with NoIP, NoAgent properties with Use piggyback data from other hosts if present enabled
  2. on a host that I will monitor via checkmk agent create some files on:
    /var/lib/check_mk_agent
<<<ClusterFoo>>>
0 "PIGGYSERVICE1" - script ended successfully
  1. see that PIGGYSERVICE1 on host “ClusterFoo”

here’s the log of the service discovery of ClusterFoo

OMD[mysite]:~$ cmk -Ivvvvv ClusterFoo
Discovering services and host labels on: ClusterFoo
ClusterFoo:
+ FETCHING DATA
  Source: SourceType.HOST/FetcherType.PIGGYBACK
[cpu_tracking] Start [7fca58865130]
No piggyback files for 'ClusterFoo'. Skip processing.
[PiggybackFetcher] Fetch with cache settings: NoCache(base_path=PosixPath('/omd/sites/mysite/tmp/check_mk/data_source_cache/piggyback/ClusterFoo'), max_age=MaxAge(checking=0, discovery=120, inventory=120), disabled=False, use_outdated=False, simulation=False)
[PiggybackFetcher] Execute data source
[cpu_tracking] Stop [7fca58865130 - Snapshot(process=posix.times_result(user=0.009999999999999787, system=0.0, children_user=0.0, children_system=0.0, elapsed=0.0))]
+ PARSE FETCHER RESULTS
  Source: SourceType.HOST/FetcherType.PIGGYBACK
Loading autochecks from /omd/sites/mysite/var/check_mk/autochecks/ClusterFoo.mk
No persisted sections loaded
  -> Add sections: []
Received no piggyback data
+ EXECUTING HOST LABEL DISCOVERY
Trying host label discovery with:
+ PERFORM HOST LABEL DISCOVERY
+ EXECUTING DISCOVERY PLUGINS (0)
  Trying discovery with:
Loading autochecks from /omd/sites/mysite/var/check_mk/autochecks/ClusterFoo.mk
Trying to acquire lock on /omd/sites/mysite/var/check_mk/autochecks/ClusterFoo.mk
Got lock on /omd/sites/mysite/var/check_mk/autochecks/ClusterFoo.mk
Releasing lock on /omd/sites/mysite/var/check_mk/autochecks/ClusterFoo.mk
Released lock on /omd/sites/mysite/var/check_mk/autochecks/ClusterFoo.mk
SUCCESS - Found no new services, no new host labels

So basically…this doesn’t work ;D I don’t see any PIGGYSERVICE1 on “ClusterFoo” host. What am I doing wrong?

Hi @sgala ,

your local script should output like this:

<<<< hostname>>>>
<<< local>>>
script output

3 Likes

Hi @ricardoftribeiro, thanks!!!

tried with this content as output of the local check on the host where checkmk agent has been executed:

<<<<ClusterFoo>>>>
<<<local>>>
0 "PIGGYSERVICE1" - script ended successfully
<<<<<>>>>

And now the PIGGYSERVICE1 service has been correctly discovered on ClusterFoo host! Amazing! :smiling_face_with_three_hearts:

2 Likes

Correction. The end of the section should be:
<<<<>>>>
(four < and four >) :sweat_smile:

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.