how to find a host belongs to which hostgroup

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
axvers
Posts: 65
Joined: Tue Jan 08, 2019 8:31 pm

how to find a host belongs to which hostgroup

Post by axvers »

Hi,

we checked the api doc on Nagios XI.

Both hostgroup "Object" and "Config" provide member lists;

but there is no api for "input host, output its hostgroup".

Is there a function for this? without additional script?

Thanks!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: how to find a host belongs to which hostgroup

Post by scottwilkerson »

You can get them with the objects/hostgroupmembers API

Run command like this

Code: Select all

/nagiosxi/api/v1/objects/hostgroupmembers?apikey=APIKEY&pretty=1&host_name=INPUTHOST
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked