Adding Existing Hosts to Existing Host Groups
-
mananatmacys
- Posts: 7
- Joined: Wed Jun 19, 2019 2:14 pm
Adding Existing Hosts to Existing Host Groups
How can I use the API to add existing hosts to existing host groups?
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Adding Existing Hosts to Existing Host Groups
Hello,
Modifying the hostgroup using the REST API will re-write the members list. For example, to add host1 and host2 to the test-group, the command would be as follows:
You'll find sample commands for your server in Help > API Docs > Config Reference.
Let me know if you have any questions.
Modifying the hostgroup using the REST API will re-write the members list. For example, to add host1 and host2 to the test-group, the command would be as follows:
Code: Select all
curl -XPUT "http://<ip-address>/nagiosxi/api/v1/config/hostgroup/test-group?apikey=<your api key>&pretty=1&members=host1,host2&applyconfig=1"
Let me know if you have any questions.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!