Director how-to merge vars.LISTs from different import sources

Hi,

I´m trying to automate the creation of hosts on my Icinga-director by importing from a database the FQDN/OS version and a predefined set of vars;

and then I want to merge and replace some of those vars.

When I try to merge the vars, the latest imported takes prececende,

example:
Import source 1:
ColumnName: FQDN of the host
Column vars:

{
  cpu_load_crit: "2,1.5,1",

  services: [
      "SNMP",
      "MySQL"
    ],
}

Import source 2:
ColumnName: FQDN of the host
Column custom_variables:

{
  cpu_load_crit: "12,8,6",

}

Import source 3:
ColumnName: FQDN of the host
Column custom_variables:

{
  services: [
    "MySQL-slave"
  ]
}

As per documentation, using a Sync rule (rule order 3) to
replace ${vars.cpu_load_crit} should end tiwh the nes value of cpu_load_crit: “12,8,6”,
and the Sync Rule to MERGE ${vars.services} should create the list:

[
      "SNMP",
      "MySQL",
      "MySQL-slave"
]

Sync Rule:

Yet the merge behaviour does not work, an I get a replacement with the latest value: namely a single mysql-slave service. (the cpu_load does get replaced thought).

Preview:
image

image

Can anyone share how to actually override data on the sync rules with the merge command… if at all possible?

Th
Before you ask a question, you can check the troubleshooting documentation ºfirst, maybe you can find an answer here.
Checked automation, but this similar topics show no solution for my issue

Give as much information as you can, e.g.

  • Director version (System - About): 1.10.2
  • Icinga Web 2 version and modules (System - About): 2.11.4
  • Icinga 2 version (icinga2 --version): icinga2-2.13.6-2.el7.x86_64
  • Operating System and version: CentOS 7.9.2009 : x86_64
  • Webserver, PHP versions: 7.3.29

I’m not sure but try to use the multiple import sources in one combined sync rule.

Hi Dominik, thanks for your reply,
I am combining the 3 import source (data) into a single sync rule (to produce objects); that’s listed on the sync rule properties image, where the import sources are named:
mysqlnodes, mysql_laves and mysql_overries

My concern is about the end result not merging a list property but replacing its value with the latest entry; as thought it were parsed as text, and not as an object.

Sadly the documentation isn’t so good and I also have to experiment quite a lot until I get imports working the way I like.