Page 1 of 1

api call to determine templates applied to host?

Posted: Mon Feb 13, 2017 3:41 pm
by lukesullivan
I'm using templates for a few things in xi, and would like to be able to programmatically determine if a template is applied (using the template when creating the host is straightforward, now I want to be able to query for what templates a host has applied).

It doesnt appear that is possible. Am I missing something? An ability to use a template via the api without the ability to query for it later seems awkward.

Also, templates can be applied via the api with use=<template>... can templates be removed via api call?

thanks,

-Luke

Re: api call to determine templates applied to host?

Posted: Mon Feb 13, 2017 4:37 pm
by rkennedy
I filed a feature request for the ability to view the current running configuration, including the template -

Code: Select all

NEW TASK ID 11030 created - Nagios XI Feature Request: Allow querying of current configuration through API
As for your second question -
Also, templates can be applied via the api with use=<template>... can templates be removed via api call?
When using the API, there isn't a delete function. If you add a service twice, then the expectation is the second call replaces all configurations that previously existed.

Re: api call to determine templates applied to host?

Posted: Wed Mar 01, 2017 1:59 pm
by tmcdonald
Just checking in since we have not heard from you in a while. Did @rkennedy's post clear things up?