Migrating hosts in distributed env (REST)

I am trying to further sub-divide an existing distributed setup. I have read the documentation at Distributed monitoring - Scaling and distributing Checkmk

I want to automate as much as practical. However…

  1. I can’t see how to change the “monitored on site” attribute for a host via the API. The /objects/host_config/${TARGET} output does not contain any obvious candidates,

  2. I want to preserve the graphs - should I copy these before migrating? Immediately after? Wait for the new site to create the RRD files then overwrite them?

Hi @wocket and welcome to the community! :wave:

  1. You want to do that on folder level and drop the hosts into the appropriate folders. I do not know the key you need from the top of my mind, but someone will be able to provide it.
  2. You should copy them in advance, to have the least data loss.

Have you set the attribute on the host and not the WATO folder? If its set on the folder level the API will not return it unless you tell the api to show inherited data.

We just overwrite them when/if we need to move a host from one server to another in a distributed monitoring setup. So host is moved first in our case.

There is also a GitHub project that will do this for you, dont have it here but try to google for it .

Is there anyway to automatically do this?
It makes no sense to migrate the host but not all its data…

Part of the data will be already migrated. But not RRDs, and monitoring history. The latter is next to impossible.

For RRDs, see the aforementioned github project by bastian kuhn

Thanks!!

For the moment I didnt find anything on bastian’s github repositories…

I will continue searching on github

Also can’t find it anymore.
But there is an important hint here, which you need to consider:

1 Like