I am trying to finalize my icinga2 setup with the director. From ‘base’ icinga2 I configured my setup using zones and endpoints in a (1x) master - satellite - agent setup.
Now, I wish to import zones, endpoints, hosts and services and set sync rules. for zones I solved the import by setting a modifier combining ${certname}_${title}
into my (new) target property ‘import_zone’. I am not sure if this is useful (I get zones like master.fqdn_satellite.fqdn and also satellite.fqdn_master.fqdn and this does not feel right - oh and btw: i set my zone names as the corresponding fqdn). for the sync rule i filter out director-global, global-templates and master and for the property it is sufficient to set ${parameters.parent}
for the ‘parent’ destination field (leaves empty or sets parent parameter if given in the import).
My problem actually appears when I try to sync my endpoints. here, i import (from my puppetdb) with the key column name ‘certname’ and i have two property modifiers: 1. title -> import_endpoint, where i combine ${certname}_${title} as in the zones’ case. I furthermore add a regular expression filter to keep only matching rows for when certname == title. this does work (I get 3 endpoints: ‘master-master’, ‘satellite-satellite’ and ‘agent-agent’ (well, I have the certname key column name so I have the three fqdn’s).
It does fail when trying to define a sync rule and I think this has to do with me not understanding sync rules properly yet. As I understand it, my sync rule should basically just define the endpoints with an empty field. I tried to do it as in the zones’ case by setting the destination field to port and a custom expression ${parameters.port}
but this gives me an error “Undefined offset: 3”.
i think of the zones.conf, where i have the imported endpoints like:
object Endpoint "my_endpoint" {
}
But i cannot set a property which just “does nothing”, compare with my example with the offset-error.
How can I resolve the issue to sync my imported endpoints? Do you see any fundamental missunderstanding in the use of import and sync rules as i describe it?