Page 1 of 1

Create service by command line

Posted: Wed May 20, 2020 7:48 am
by steph007
Hi,

I'm using something the Bulk Host Cloning and Import to create multiple Hosts in Nagios XI, and I wondering if something similar exist for Services?
I have to create a lot of services and would use something similar.
If not, is there a command line that I can use to create a service? I could at that moment use a script to create all my services I need to add.

Re: Create service by command line

Posted: Wed May 20, 2020 12:59 pm
by benjaminsmith
Hi @steph007,

There are couple of options here. One approach is to create a service and then assigned this service to a hostgroup in the CMM. All of the hosts in the hostgroup will inherit the service.

We have a Pro Tip video on how to do this that I would recommend watching.

https://youtu.be/Qj_HALNyWvc

You can also use the REST API to add a service to a host. The API is fully documented in the user interface, got to Help > API Docs. Then find the Config Reference in the left-hand sidebar, and got to POST > config/service.

Let us know if you have more questions.

Re: Create service by command line

Posted: Tue Jun 02, 2020 3:52 pm
by steph007
Thanks, I chose to create file and import it in Nagios

Re: Create service by command line

Posted: Tue Jun 02, 2020 4:10 pm
by scottwilkerson
steph007 wrote:Thanks, I chose to create file and import it in Nagios
Great!

Locking thread