i am currently facing an interesting problem using the Director Rest-API.
Trying to add entries to a data list via the API, is resulting in really weird behavior looking at the result in the webUI.
First of all, here are all informations of my setup:
Your syntax is correct, but the variable name is not, it should not contain - but _ instead. Because of this the director has to use the different syntax which has the same meaning. And very likely this syntax confuses Icinga Web 2.
Thank you for the fast reply @dgoetz!
Changing the variable name does indeed result in the list beeing shown correctly in the activity log:
…but the incorrect mapping in the custom variables view remains:
This also begs the question if there is a workaround possible, to still use a “-” in the data list name?
My data list is already in use on a large portion of hosts, changing the name would cause a lot of overhead.
Another thing to take note of:
The custom variables overview in the webinterface is wrong, but the variables are correctly defined when looking in the inspect tab.
It seems like a bug in the director api, where the api is correctly assigning the values, but on some other part of the processing, the variables get messed up and are therefore not shown correctly in the webui.
I tested this with a command, using the variables and could correctly use them.
Alright, this situation gets more and more confusing by the minute.
I added the data list via the director api, as explained in my last comments and since there was no fix for the incorrect mapping, i just let it sit there overnight.
Coming back to the problem this morning, all of a sudden, without any changes from my side, the problem was magically fixed:
Does anyone have any explanation to this?
Does the director run some sort of cleanup tasks overnight or am i missing something completely here?
In this part the Director is not involved (its job is finished after the configuration was deployed to Icinga 2), it is just Icinga 2 writing to IDO and Icinga Web 2 reading from IDO. As far as I know there was a bug in older versions regarding the update of custom variables by Icinga 2, but this should be fixed and I am not aware of another open one.