Page 1 of 1
API questions
Posted: Thu Feb 28, 2019 4:26 pm
by andrewatmacys
Is it possible to add a host to a hostgroup where both are previously existing via the API? Say I have host_1 through host_1000 and I want to add them all to hostgroup_3 via the API, can I do that?
Also, is there a way to adjust check_interval values via the API? I tried to modify the value for all hosts in a hostgroup but it corrupted the configs and wouldn't let me apply.
Re: API questions
Posted: Fri Mar 01, 2019 12:49 pm
by npolovenko
Hello,
@andrewatmacys. You can submit an API command to add a new hostgroup, but specify the same hostgorup name. That way the command is going to override the existing hostgroup definition and will allow you to add new hosts.
Same applies to overiding host configs with API commands. I don't think you can bulk modify all hosts in a hostgroup with an API command. Can you show me how you tried doing that?
Re: API questions
Posted: Fri Mar 01, 2019 1:46 pm
by andrewatmacys
The bulk modification was a separate event, I should have clarified that from the start, my mistake.
So I would have to individually list every host we wanted to modify in the case of the check_interval setting?
Re: API questions
Posted: Fri Mar 01, 2019 3:22 pm
by scottwilkerson
andrewatmacys wrote:The bulk modification was a separate event, I should have clarified that from the start, my mistake.
So I would have to individually list every host we wanted to modify in the case of the check_interval setting?
Via the API yes.
Or you can change settings in bulk via
CCM -> Bulk Modifications Tool
Click "Change a single configuration option"