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!
how to find a host belongs to which hostgroup
-
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
You can get them with the objects/hostgroupmembers API
Run command like this
Run command like this
Code: Select all
/nagiosxi/api/v1/objects/hostgroupmembers?apikey=APIKEY&pretty=1&host_name=INPUTHOST