Adding Host via API with Template

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
UWBernie
Posts: 16
Joined: Wed Mar 21, 2018 9:30 am

Adding Host via API with Template

Post by UWBernie »

I'm looking if there is a better way to solve adding a host via api with a template for use in an automation script when deploying new hosts.

Currently the POST config/host is limited to a number of required parameters that are already handled by our template. If I use the POST config/import I can add a host with a template using the following request body
define host {
host_name ******
address *****
use windows-server
contact_groups *****
notification_period win_wed_0300
register 1
}

then I need to apply the config using POST applyconfig as POST config/import does not respect the applyconfig=1 parameter.

Is there a better way?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Adding Host via API with Template

Post by lmiltchev »

Have you tried using "force=1"?
example-01.jpg
You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked