i would like to know if it is possible to use the restapi to create a service and attach it to a template so that i don't have to pass all parameters. something like the below but with a template so that the numerous service checks i am creating have inherited settings, it seems like this should work but it sets the options to 0 or disabled that are ''. Also, how do i get the service name to match the service_description instead of the host_name?
"host_name=#{host_name}&service_description=dev-oracle-query-dw-#{param_row['SUBJECT_AREA']}-#{param_row['SESSION_NAME']}&"\
"check_command=check_ll_oraclequery_dw_batch_single_lldwd_app\!#{param_row['SUBJECT_AREA']}\!#{param_row['SESSION_NAME']}&check_interval=''&retry_interval=''&max_check_attempts=''&check_period=''&contacts=''¬ification_interval=''¬ification_period=''&use=ll_oraclequery_service_prod_15_min&applyconfig=1"
rest api service check creation add template param
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: rest api service check creation add template param
Currently this is not possible.
The API wants you to define the variables even though the template includes them.
We have a feature request #7028 pending for this and I will also link this forum thread to the feature request.
The API wants you to define the variables even though the template includes them.
We have a feature request #7028 pending for this and I will also link this forum thread to the feature request.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: rest api service check creation add template param
Is there a way to change the service name when it is created so it doesn't match the hostname?
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: rest api service check creation add template param
Unfortunately not at this point in time.
I created a feature request for this, TASK ID 7101.
I created a feature request for this, TASK ID 7101.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: rest api service check creation add template param
Thank you for answering my questions. Please close this loop.
Re: rest api service check creation add template param
Unlocking at the request of @Box293 who said he had some additional input.
Former Nagios employee
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: rest api service check creation add template param
@BanditBBS messaged me as he has some info I did not know about.Box293 wrote:Currently this is not possible.
The API wants you to define the variables even though the template includes them.
We have a feature request #7028 pending for this and I will also link this forum thread to the feature request.
For example:BanditBBS wrote:It is possible to use the use= to use a template and use the force=1 so it doesn't require all fields!
Code: Select all
curl -XPOST "http://xitest/nagiosxi/api/v1/config/service?apikey=7gobcg3s&pretty=1" -d "host_name=test_host&service_description=PINGxxxx&use=template_ping_service&force=1&applyconfig=1"As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.