Page 1 of 1

[API] Create Service Template

Posted: Tue Oct 16, 2018 1:21 pm
by Maxwellb99
Hi,

Is there a way to create a service template via the API? I tried to throw the register 0 flag on there but that just sets it to inactive.

Thanks,
Maxwell Ramirez

Re: [API] Create Service Template

Posted: Tue Oct 16, 2018 1:26 pm
by jomann
Service templates are special in the CCM so we currently don't support them. It's a feature request that will be in newer versions of XI. However, for the time being you can use config/import to import a full service template definition like:

Code: Select all

curl -XPOST "http://xiserver/nagiosxi/api/v1/config/import?apikey=apikey&pretty=1" -d '
define service {
    name                            test-service
    use                             generic-service
    max_check_attempts              4
    check_interval                  5
    retry_interval                  1
    register                        0
}'

Re: [API] Create Service Template

Posted: Tue Oct 16, 2018 1:34 pm
by Maxwellb99
Tracking. Thank you.

Is create contact coming down the pipe? I'm having to do a similar import object to create contacts.

Thanks,
Maxwell Ramirez

Re: [API] Create Service Template

Posted: Tue Oct 16, 2018 2:34 pm
by jomann
Yup, the contact creation via the API is also on the roadmap. It should be available in 5.6.