Hi
I’ve a question about icinga and api structure.
I’ve some config i’ve added manually (with differents zones):
/etc/icinga2/zones.d
zone1
zone2
…
On these zones i create my hosts, hostgroup, …
And in the same time i use API for some hosts:
/var/lib/icinga2/api/packages/_api/XXXX-XXX-XXXX-XXX-XXXXXXXX
conf.d
include.conf
zones.d
My “problem” is that all host i create with api are correctly created but in:
/var/lib/icinga2/api/packages/_api/XXXX-XXX-XXXX-XXX-XXXXXXXX/conf.d/hosts
server1.zone1
server2.zone1
server1.zone2
…
Is it possible with the API to put all servers from one zone in one directory from example in
/var/lib/icinga2/api/packages/_api/XXXX-XXX-XXXX-XXX-XXXXXXXX/zones.d/zone1
…
I create my object like this:
curl -k -s -u admin:$PASSWORD_API_ADMIN -H ‘Accept: application/json’ -X PUT ‘https://localhost:5665/v1/objects/hosts/server1’ -d '{ “templates”: [ “generic-host” ], “attrs”: { “address”: “XX.XX.XX.XX”, “check_command”: “hostalive”, “zone”: “zone1”, “vars”: {“services”: [“XXX”]} }, “pretty”: true }
In fact i will have many servers to add and i’d like to have a proper structure if possible (one directory for one zone and perhaps one subdirectory for some servers for a zone)
Thanks for help
Alex