Skip to main content

Hi everyone, 

I’m running 24.04, and try to use the APIv2 to maintain some HostGroup to Host  by script.
I can do what I want, but maybe I have a ‘bug’:

I use a command method ‘PATCH’ to update a single Host configuration, by modifying only the ‘groups’ item (by passing an array of integer (of HostGroup ID)).
https://docs-api.centreon.com/api/centreon-web/24.10/#tag/Host/paths/~1configuration~1hosts~1%7Bhost_id%7D/patch


That work like a charm BUT, after doing that, I can’t export poller configuration anymore.
It seems like this command add a ‘null’ value to Host Categories:

After that if I go to the host configuration, clic the cross to ‘delete’ host category (but in fact, there is none), and save. Then I can export poller configuration again.

Does someone have a way to update only ‘groups’ for a ‘host’ ?

Yeah ok, that’s a bug ..
https://github.com/centreon/centreon/issues/4699

 

If anyone have the same problematic and can suggest a way to update host group for a host by script, I’m interested.


Reply