Integrate automatically new Hosts in Map with Director

(Maurice) #1


i have a little problem with the automatically adding new Hosts in Maps.
I have configured the automatically rollout how it is explained in the following example

My Problem know is how I can add the needed code

 var loc = getHostGeoLocation(name)
 if (loc) {
    vars.geolocation = loc

with the Icinga Director?

Whenn I copy the code in the gerneric group, after the next reload from Icinga2 the code is overwritten, that is normal. But with the Datafields and Lists I dont know how I can realize the Problem.
Has anyone an idea for that Problem?

(Michael Friedrich) #2

That’s not possible with the Director, you can only do this inside the Icinga 2 DSL in static configuration files. The Director does not support inlining DSL code like functions or conditions.