2

I am using the snapshot version of icinga2 for the api feature . I was able to successfully add hostgroups and hosts dynamically through the api and query them .

However , i am not able to see the hostgroup added through the api in icingaweb2 .

Here is what i am doing :

To add hostgroup : curl -k -s -u icingaadmin:icinga 'https://localhost:5665/v1/objects/hostgroups/testgrp' -X PUT -d '{ "attrs": { "name" : "testgrp" ,"display_name" : "testgrp" , "state_loaded" :true }}'

To add host :

curl -k -s -u icingaadmin:icinga 'https://localhost:5665/v1/objects/hosts/8.8.8.8' -X PUT -d '{ "templates": [ "generic-host" ], "attrs": { "address": "8.8.8.8" , "groups" : [ "testgrp" ]} }'

In the UI , i am not able to see the hostgroup created through the API ,however the host is visible in UI .

  • Just found that , after adding through API , i have to restart , for it to be visible in UI . Is there any way , we can do it without restart of icinga2 process – Madhusmita Gochhait Nov 09 '15 at 20:09

1 Answers1

1

Thanks for the tests, we've fixed the bug in the current snapshot builds now being ready for release on monday.

https://dev.icinga.org/issues/10604

dnsmichi
  • 466
  • 3
  • 11