Page 1 of 1
restapi 5.2.0 post/user and post/service
Posted: Mon Nov 30, 2015 7:35 pm
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?
Re: restapi 5.2.0 post/user and post/service
Posted: Tue Dec 01, 2015 3:00 pm
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.
Re: restapi 5.2.0 post/user and post/service
Posted: Tue Dec 01, 2015 9:33 pm
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.