Create service by command line

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
steph007
Posts: 177
Joined: Mon Jul 24, 2017 12:00 pm

Create service by command line

Post 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.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Create service by command line

Post 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.
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!
steph007
Posts: 177
Joined: Mon Jul 24, 2017 12:00 pm

Re: Create service by command line

Post by steph007 »

Thanks, I chose to create file and import it in Nagios
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Create service by command line

Post by scottwilkerson »

steph007 wrote:Thanks, I chose to create file and import it in Nagios
Great!

Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked