Edit hosts with REST api
Posted: Mon Apr 18, 2016 6:07 am
Hi,
Is it possible to edit hosts via REST API?
We would have a need to add different contact group based on few factors, and doing that manually will be tedious job.
I have tried to do so with:
But in that the contact_group was not added either in the first place.
So is this anyway even possible?
My version of Nagios XI is 5.2.0
Is it possible to edit hosts via REST API?
We would have a need to add different contact group based on few factors, and doing that manually will be tedious job.
I have tried to do so with:
Code: Select all
curl -XPOST "http://x.x.x.x/nagiosxi/api/v1/config/host?apikey=xxxxxxxxxxx&pretty=1" -d "host_name=testapihostapply&address=127.0.0.1&contact_groups=test_group_1&max_check_attempts=2&check_period=24x7¬ification_interval=5¬ification_period=24x7&applyconfig=1"
curl -XPOST "http://x.x.x.x/nagiosxi/api/v1/config/host?apikey=xxxxxxxxxxx&pretty=1" -d "host_name=testapihostapply&address=127.0.0.1&contact_groups=test_group_2&max_check_attempts=2&check_period=24x7¬ification_interval=5¬ification_period=24x7&applyconfig=1"
So is this anyway even possible?
My version of Nagios XI is 5.2.0