API - retrieve list of Hosts with specific Contact

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
yo_marc
Posts: 83
Joined: Thu Aug 11, 2016 1:56 pm

API - retrieve list of Hosts with specific Contact

Post 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
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: API - retrieve list of Hosts with specific Contact

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
yo_marc
Posts: 83
Joined: Thu Aug 11, 2016 1:56 pm

Re: API - retrieve list of Hosts with specific Contact

Post by yo_marc »

That's great - thank you!
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: API - retrieve list of Hosts with specific Contact

Post by benjaminsmith »

Your welcome!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked