[icinga-users] Director-API recognize error but syncronize it anyway

Jean-Denis Gebhardt jd at der-jd.de
Mon Jan 23 12:23:23 CET 2017


Hi,

I reacently played arround with the Director-API.
Push a host -> works as expected.
Push a host with nonesense -> works kind of unexpected.

curl -H 'Accept: application/json' -u "$ICU:$ICP" 
'https://<icingahost>/icingaweb2/director/host' -d '{"object_name": 
"test.example.de", "object_type": "object", "display_name": 
"test.example.de", "address": "127.0.0.1", "imports": 
["generic-director-host", "blubber"]}' -X POST -D -
HTTP/1.1 500 Internal Server Error
Date: Mon, 09 Jan 2017 16:57:07 GMT
Server: Apache/2.4.10 (Debian)
Content-Length: 58
Connection: close
Content-Type: application/json

{
   "error": "Failed to load icinga_host \"blubber\""
}

curl -H 'Accept: application/json'  -u "$ICU:$ICP" 
'https://<icingahost>/icingaweb2/director/host?name=test.example.de&resolve' 
-L -D -
HTTP/1.1 200 OK
Date: Mon, 09 Jan 2017 16:58:34 GMT
Server: Apache/2.4.10 (Debian)
Vary: Accept-Encoding
Content-Length: 174
Connection: close
Content-Type: application/json
{
   "address": "127.0.0.1",
   "display_name": "test.example.de",
   "object_name": "test.example.de",
   "object_type": "object"
}

API returns a error. The API and webfrontend is telling me, that the 
faulty part (imports) was not synced.
After a testdeployment the effectiv host-configuration object reveals 
that the error was pushed anyways.

Can somone explain me that behaviour. Is it a bug? I would expect to see 
the faulty part as error when quering the host-object.

Thanks,
J-D


More information about the icinga-users mailing list