Page 1 of 1

API query hostgroup member IP addresses

Posted: Tue Oct 12, 2021 7:55 am
by elinagios
Hello

curl -XGET "https://servername/nagiosxi/api/v1/obje ... E&pretty=1"

This gets me specific hostgroup members and their name, is it possible to get also hostgroup member IP with same GET ?

Thank you.

Re: API query hostgroup member IP addresses

Posted: Tue Oct 12, 2021 4:14 pm
by kfanselow
Hi elinagios,

You can find the API definitions in NagiosXI via help ( top of page ) -> API Docs (left hand side).

Looking at the definition for hostgroupmembers it doesn't look like you can pull the IP with this call and you will have to make a second call to config/host (under Config Reference in API Docs) with the hostname to config/host to get the IP.

Code: Select all

curl -ik -XGET "https://localhost/nagiosxi/api/v1/config/host?apikey=REDACTED&host_name=HOSTNAME&pretty=1"