Replace host of import with icingacli

Hello,

I have a question about icingacli.

We want to move 200 hosts from master to satellite.
The zone is defined in the host template or service template.

How can I change the import “zone-old” to “zone-new” via icingacli?
Or other solution?

Thx

Hi,

I would like to know, what CLI are you trying to use?

Also, I would like to know what version of Icinga 2 and Director you are currently using.

Thanks.

Hello

Icinga 2.10.5-1
Director 1.6

I use icingacli director for changes,
but i have not found how to change the imports

thx

Hello,

The following command will update the template for the host, this could help:

icingacli director host set myhost --imports my-new-template host-ip

You could try to create a script where getting the name of those hosts and then applying the command below.

Another option could be:

You could create a basket that includes all hosts and services, and then you dump the basket. You will get a large json file, then change the json file with a script (eg. with ` sed) and them re-import it.

Let me know your thoughts!