Page 1 of 1

Creating Nagios hosts and service via API

Posted: Thu May 21, 2020 9:18 am
by acentek
We are looking to automate the creation of hosts and services in Nagios XI.

I've looked at that API a little bit but is the CLI or is the API where I should go to offer this?

Or should I stop what I am looking at and get my fingers stretched and ready for a lot of manual creation.

Re: Creating Nagios hosts and service via API

Posted: Thu May 21, 2020 4:58 pm
by ssax
You would use the API.

The curl commands listed in the API help are just a CLI way of doing it (either from the local XI server OR from a remote linux box with curl installed).

You can technically call it any way your want (from a script, from a remote machine, etc). You don't need to use curl, it's just an easy one to use.

The curl commands are just examples with curl, you would need to script them out if you want full automation.

The URL and the data are what's important. Curl is just one method of querying and submitting the data.