Page 1 of 1
How to add New host to existing service through cmd
Posted: Tue Feb 09, 2021 2:32 pm
by bhsupport
Hi Team,
can you help, how to add new hosts to existing services all a time?
Thanks,
kish.
Re: How to add New host to existing service through cmd
Posted: Wed Feb 10, 2021 12:31 pm
by benjaminsmith
Hi kish,
Welcome to the Nagios Customer Support Forum!
You can do this easily in the CCM by searching for the service and selecting the Manage Hosts button.
add-hosts-service.png
If you want to do this from the CLI using the REST API, here's an example command. The REST API is fully documented in the GUI by going to Help > API Docs.
Code: Select all
curl -XPUT "https://<IPADDRESS>nagiosxi/api/v1/config/service/host-01/PING?apikey
<APIKEY>&pretty=1&display_name=PINGTEST&host_name=host-01,host-02&applyconfig=1"
Hope that helps answer your question. Let us know if you need clarification on anything.
--Benjamin