I’m looking for a possibility to rename hosts and services in Icinga 2 without losing their state history.
If I rename a host in my config files, a new one will be created with an empty state history.
I guess it would be pretty unsafe to modify the object_id colum in the relevant tables (icinga_commenthistory, icinga_comments, icinga_downtimehistory, icinga_flappinghistory, icinga_statehistory)?
Is there a preferred method to achieve this?
I know that there are other things to consider (e.g. naming of InfluxDB measurements), but as of now, I’m only concerned about the Icinga 2 side of things.
Would setting the “display_name” attribute for your host and service
definitions achieve what you want?
That leaves the objects themselves still with the same name (and therefore
ID), but anywhere they’re displayed (for example in Icingaweb2), they’ll have
the alternative names.
thanks alot for your suggestion with setting the display_name.
Unfortunately I’m looking for a “true” rename, since we would like to implement a consistent naming scheme and want to align all currently existing objects to that scheme.
I would like to reserve the display name for cases where someone needs to find a host / service by a completely different alias, if that makes sense
You could try using the Director mode with {icingacli}; don’t know if that also nixes the state histories. This is assuming you are using the Director module in Icinga2 at all.