restapi 5.2.0 post/user and post/service

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
doneil326
Posts: 82
Joined: Fri Aug 14, 2015 3:26 pm

restapi 5.2.0 post/user and post/service

Post by doneil326 »

is there a way to pass a query string parameter to assign a users authentication method to an ldap provider that has been setup? so the auth type, ad server, ad username fields?

also, in the post/service is there a way to specify a hostgroup instead of just a host?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: restapi 5.2.0 post/user and post/service

Post by tmcdonald »

The developers have clarified that everything that's in the API Help page is what's currently available, and I don't see anything about the AD settings. I also only see a single host in the options, so it looks like at this time a hostgroup is not available either.
Former Nagios employee
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: restapi 5.2.0 post/user and post/service

Post by Box293 »

I have recently discovered the &force=1 argument that allows you bypass the required options:

For example this command will create the service which uses a template AND it also uses a hostgroup_name instead of a host_name.

Code: Select all

curl -XPOST "http://xitest/nagiosxi/api/v1/config/service?apikey=5doa2g8s&pretty=1" -d "hostgroup_name=test_hostgroup&service_description=PINGjjj&use=template_ping_service&force=1&applyconfig=1"
I did notice that the "Config Name" in CCM becomes the name of the hostgroup.

NOTE: I've used a template in this example which has all the required directives like check_interval etc. Make sure you are creating valid service definitions otherwise nagios core will fail the verify.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked