API query hostgroup member IP addresses

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
elinagios
Posts: 146
Joined: Thu Feb 16, 2017 3:45 am

API query hostgroup member IP addresses

Post 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.
User avatar
kfanselow
Posts: 254
Joined: Tue Aug 31, 2021 3:25 pm

Re: API query hostgroup member IP addresses

Post 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"
Locked