Hi.
On my system, I need to change, massively, hostname from fqdn to hostname without domain suffix.
i.e.
machine1.local.domain
machine2.local.domain
.
.
to
machine1
machine2
.
.
How could I execute this massively?
So, I need to change: “object_name”
Could I use api director with POST or PUT method?
Thanks a lot.
Mario
Director version (System - About): 1.11.1
Icinga Web 2 version and modules (System - About):2.12.1
UPDATE icinga_host SET object_name = REPLACE(object_name, '.local.domain', '') FROM icinga_host_inheritance WHERE (icinga_host_inheritance.parent_host_id = 6) AND (icinga_host.object_name like '%local.domain%')
In my case, I added the inner join with icinga_host_inheritance because my hosts has the import template like icinga_host_inheritance.parent_host_id = 6