Page 1 of 1

API - retrieve list of Hosts with specific Contact

Posted: Thu Mar 11, 2021 3:18 pm
by yo_marc
Hello Nagios Support,

As part of an automation project, I am trying to retrieve a list of Hosts which use a specific Contact. I am able to get the necessary info using a GET config/host request, and parse the data. However, we hit a problem with the Hosts that use the + (append) option in the Contact configuration. For those, the API returns the following result, hiding the assigned Contacts:

Code: Select all

"contacts": "+Array",
Is there an extra arg or option to expand that array? Or is there an otherwise different way to get the info we need?

Thanks,
-marc

Re: API - retrieve list of Hosts with specific Contact

Posted: Fri Mar 12, 2021 1:28 pm
by benjaminsmith
Hi Marc,

Thanks for bringing this to our attention, I was able to replicate this on my test system and it's a bug in the API. I've submitted a bug report and we'll have this fixed in the next maintenance release of Nagios XI.

Let me know if you have any questions.

Best Regards,
Benjamin

Re: API - retrieve list of Hosts with specific Contact

Posted: Tue Mar 16, 2021 7:23 am
by yo_marc
That's great - thank you!

Re: API - retrieve list of Hosts with specific Contact

Posted: Tue Mar 16, 2021 3:55 pm
by benjaminsmith
Your welcome!