Template API Endpoint

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
J.A.K
Posts: 103
Joined: Wed Aug 05, 2020 11:39 am

Template API Endpoint

Post by J.A.K »

Just wanted to check before I wrote something for it. Are there any POST options off the config API endpoint for host\service template creation? I'm not seeing anything in the API reference but wanted to validate real quick.
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: Template API Endpoint

Post by dchurch »

You could always try the raw config/import endpoint with a raw host template definition (a host template is a regular host definition with register 0):

Code: Select all

curl -X POST 'http://127.0.0.1/nagiosxi/api/v1/config/import?apikey=<MY API KEY>&pretty=1' -d '
define host {
    host_name           my_new_host_template
    use                 xiwizard_generic_host
    register            0
}'
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.

Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
J.A.K
Posts: 103
Joined: Wed Aug 05, 2020 11:39 am

Re: Template API Endpoint

Post by J.A.K »

Oooh that's certainly an idea worth trying. I didn't think of that. Thank you!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Template API Endpoint

Post by lmiltchev »

@J.A.K, let us know if you have any further questions or if it is safe to close the topic. Thank you!
Be sure to check out our Knowledgebase for helpful articles and solutions!
J.A.K
Posts: 103
Joined: Wed Aug 05, 2020 11:39 am

Re: Template API Endpoint

Post by J.A.K »

I think I'm satisfied feel free to close it.
Locked