Nagios XI API Capabilities/Clarification

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Benco_NAdmin
Posts: 3
Joined: Thu Jan 27, 2022 9:41 am

Nagios XI API Capabilities/Clarification

Post by Benco_NAdmin »

Hello,

We have recently purchased and have a Nagios XI server running. I am going through the various API documentation and I see entries for creating hosts, creating services, and creating commands. What I am not able to verify or pin down is whether there is any interwoven API functionality for applying services to hosts or commands to services.

Does the API currently have that functionality in it? Does anyone have any places to start for automated deployment of hosts in Nagios/service templates for said hosts?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Nagios XI API Capabilities/Clarification

Post by ssax »

HI! I see this is your first post and I'd like to thank you for choosing Nagios! We're happy have you in the community. Besides the support forum, please check out our knowledgebase for useful tech tips and HowTos. And to extend product functionality, you'll find thousands of plugins and addons on the Nagios Exchange. Welcome aboard!

https://support.nagios.com/kb/
https://exchange.nagios.org/

Yes, the system supports that. If the service exists you would use the PUT functionality to add hosts to the service. Please note that you would first have to query with a GET request to get the existing members, then add those members and the new members together, and update the service record. See the config/services endpoint.

You could also just attach the service to a hostgroup, then update the hostgroup with hosts GET, add the existing and new hosts together, and then PUT on the config/hostgroups endpoint as an alternative method. (e.g., services attached to hostgroups instead of directly to hosts)

The PUT method under the Help menu item in the API sections should be for updating. GET is read, POST is create, PUT is update.
- See the Common Solutions section as well

See here as well:

https://assets.nagios.com/downloads/nag ... gement.pdf

Let us know if you have any questions.
Locked