How to add New host to existing service through cmd

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
bhsupport
Posts: 1
Joined: Thu Dec 26, 2019 12:19 pm

How to add New host to existing service through cmd

Post by bhsupport »

Hi Team,

can you help, how to add new hosts to existing services all a time?

Thanks,
kish.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: How to add New host to existing service through cmd

Post 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
You do not have the required permissions to view the files attached to this post.
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!
Locked