CheckMK API - How to Add host on a Specific Site

Hi,
I have a checkmk distributed monitoring with a master and a slave. Can someone please help me to fix the API call?

Master: master.cmk.local/master
Slave: slave.cmk.local/slave

Is there a way I can hit Master API and configure a Host on Slave Site?

Note: I’m able to hit master API and add hosts on the master site.

Any help would be appreciated!

The easiest way is - assign the slave site to a folder and place the host inside this folder.
With this method every host created inside the folder is automatically assigned to the slave. Or create a host manually inside the configuration and pull the config from the API to see what parameters are set.

1 Like

Superb- that trick worked:

Blockquote
DATA=‘“attributes”:{“ipaddress”:"’$IP’“},“folder”:”‘~$FOLDER’“,“host_name”:”‘$HOSTNAME’"’

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.