Page 1 of 1
How to export the parent and child configuration on host
Posted: Tue Feb 23, 2021 4:49 am
by informatica
Hi Team,
Could you please help me how to export the data with parent and child added to which host in nagios for all hosts.
which host is having parent/child we need to export the data.
Re: How to export the parent and child configuration on host
Posted: Tue Feb 23, 2021 6:16 pm
by benjaminsmith
Hi
@informatica,
That information can be retrieved using the REST API, specifically the GET host/config endpoint. You can call this with a python/bash script and build a list of hosts and child hosts.
Code: Select all
curl -XGET "https://<ipaddress>/nagiosxi/api/v1/config/host?apikey=<APIKEY>&pretty=1"
Output:
{
"host_name": "host1.com",
"use": [
"xiwizard_xml_host"
],
"address": "host1.com",
"parents": [
"localhost"
],
Best Regards,
Benjamin
Re: How to export the parent and child configuration on host
Posted: Wed Feb 24, 2021 5:14 am
by informatica
Instead of API Do we have any other way to download the parent and child associated to which host ???
Re: How to export the parent and child configuration on host
Posted: Wed Feb 24, 2021 11:31 am
by benjaminsmith
Hi,
You can view object relationships in the CCM by clicking on the relationships link under the Actions menu. However, to generate a list or report, that would have to be done using the API or directly pulled from the nagiosql database.
--Benjamin