Closed avik78 closed 4 years ago
@avik78: no need to build it that complicated when working with Icinga Director. Just create a related data list with the key being your location and the city as it's label - all done.
Thanks - was a nice tip.
But - we also use the Automation in Director and we import 3000 AD-objects where there is a naming context for 180 locations in use already on how the objects are named.
Another way is of course to run a script towards AD to set it as an AD-attribute, but we also have some objects we add manually directly into Director.
So if I could use this example to automatically populate vars.geolocation from object name (coming from AD or manual objects) - that would be awesome.
@avik78: use import Property Modifier. Choose a "Regular Expression based Replacement" to extract your location shortcut, write it to a new target column. Next, apply a "Map" modifier to that target column and look up that location shortcut in the chosen Data List. Please note that for this task you must probably flip key and label in your list. You can of course also automate the import of the data list itself.
Closing this old issue, got no feedback. The proposed solution should work fine
Hi, I'm trying to implement this automated fashion of generation geolocations from host-objects.
https://www.icinga.com/2017/08/16/integrate-maps-into-icinga/
I cant find a way to set this in a template in Director
It work fine when using files, but I want a Director-only setup. I can live with the constants in files (from the above example in the website, but that would be great to have in Director to "have it all"
Thanks, Ole
Context
Your Environment
icinga2 --version
): r2.7.0-1