Icinga / icingaweb2-module-director

The Director aims to be your new favourite Icinga config deployment tool. Director is designed for those who want to automate their configuration deployment and those who want to grant their “point & click” users easy access to the configuration.
https://icinga.com/docs/director/latest
GNU General Public License v2.0
412 stars 202 forks source link

Icinga2 REST API variable synchronization with Icinga Director. #2887

Open haytxy opened 2 months ago

haytxy commented 2 months ago

Expected Behavior

Icinga Director should be able to update a variable object if the object has a null value and the value is already provided by Icinga Director for example in Service Template or Service Set.

Current Behavior

If previously the value for the variable object was given using Icinga2 REST API and we want to overwrite this value with the help of the Icinga Director, it is impossible.

Steps to Reproduce (for bugs)

With the help of Icinga2 REST API, I passed the value "13" for the postgres_critical variable. Which resulted in overwriting the value that I had configured in "Icinga Service Sets"

curl -k -s -S -i -u user:pass -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/objects/services/host-object!service-object -d '{ "attrs": { "vars.postgres_critical" : "13" }}'

image

I would like to reverse the process. However, when I'm using the Icinga2 REST API to overite postgres_critical and put a null value for this variable. curl -k -s -S -i -u user:pass -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/objects/services/host-object!service-object -d '{ "attrs": { "vars.postgres_critical" : null }}'

It doesn't change anything. I am unable to get back the value specified in Icinga Director. The variable postgres_critical takes the value null Inspect >> Executed Command >> '-c' '' and does not retrieve the value previously configured in Icinga Director.

I can only see the Icinga Director value under original_attributes.
image

How to use a value defined in Icinga Director if previously this value was put under variable by Icinga2 REST API?

Your Environment