api call to determine templates applied to host?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
lukesullivan
Posts: 34
Joined: Tue Jan 24, 2017 11:12 am

api call to determine templates applied to host?

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: api call to determine templates applied to host?

Post 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.
Former Nagios Employee
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: api call to determine templates applied to host?

Post by tmcdonald »

Just checking in since we have not heard from you in a while. Did @rkennedy's post clear things up?
Former Nagios employee
Locked