How to combine host vars from multiple import sources?

This forum was archived to /woltlab and is now in read-only mode.
  • I currently have an Import source which has the following results:

    Code: hosts.conf
    1. object Host "Server1" {
    2. import "generic-host"
    3. display_name = "Server1"
    4. address = "10.0.0.10"
    5. vars.os_family = "windows"
    6. }

    Now, I want to combine this with data from another source which basically looks like this:

    id software_name software_version
    7 MySQL Server1
    32 MSSQL Server1


    How could I use this data so that it becomes something like this:

    If that is not possible, I would like to know how to assign Service Sets to Hosts based on import source data.

  • I'm not using Director actually, but :


    Why don't you manage to have all your informations (hostname, ip address, mysql version, software_version, ...) in a single source ?

    It will be easy to do.

  • As stated, it's a different source.


    But okay, let's say I have this kind of result:

    server_id server_name server_ip server_osfamily software_id software_name
    1 Server1 10.0.0.20 Windows 7 MySQL
    1 Server1 10.0.0.20 Windows 32 MSSQL


    How do i process it in Director, so that i have a vars on the Host object that contains both "MySQL" and "MSSQL"?

  • I don't know many details about import sources (I did not read the docs at all, I admit it), but I would start with a simple import source and host, try to "merge" that with a separate second import source. I heard about that during Icinga Camp Berlin, so I've looked over at the GitHub issue tracker. Maybe it helps: https://github.com/icinga/icin…3&q=is%3Aissue%20merge%20

  • if it is any help for you - this is something we didn't solve with the icinga director (looks hard to accomplish at the moment) but with custom sql views tailored to import only one row per host. as with sql you can get quite creative regarding the "merge" of lines.

  • make an array out of it (thats what we do) and after that you can use that array for all kinds of apply rules..

  • As already stated, this is sadly not possible with the kinds of Data sources I need to deal with. It will be either the first way or the second way.


    It seems that I will need to wait until Director has (better) possibility to merge things?