This is not director specific, so Icinga 2 has some string functions (Library Reference - Icinga 2). I have not worked with them from within the director, but the director allows to use DSL for arguments, so it should be possible. In case of a tight name scheme I would prefer substring as a much easier option to work with strings.
A Director specific solution I have used many times when the import mechanism is used is to have a (regex) modifier which creates the hostname from the fqdn, but if this is an option depends on your environment.
Can you share this please. Is this regex option within Director - or is it while importing externally using script? I am looking for something within Director
This is located at âIcinga Directorâ > âAutomationâ > âImport sourceâ and when you select a import source, you can find it on the tab âModifiersâ. There are many modifiers which can strip the domain, so you can choose the one fitting best your scenario. But as I said it is only a option if you import the objects from some source.
Understood Dirk. Well it is not an option for us currently. We onboard using salt states
So in Director no way to strip on the fly. That is really a bummer. May be @tgelf can help ?
So are you saying this is not possible today - and can be safely going as a new feature request
Just wanted to make sure. Donât want @tgelf to say this is available feature today and I just donât know of it
Hi! I donât deny that @tgelf might be already on it but i wouldnât rely on it either.
He also has other customers to satisfy and i think in the long run a feature request where other people can subscribe and show additional interest might be the best option.
On the other hand @tgelf is always good for a surprise