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
[API] Create Service Template
Re: [API] Create Service Template
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
}'
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
Maxwellb99
- Posts: 97
- Joined: Tue Jan 26, 2016 5:29 pm
Re: [API] Create Service Template
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
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
Yup, the contact creation via the API is also on the roadmap. It should be available in 5.6.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.