Page 1 of 1

Hostgroup hosts REST API

Posted: Mon Oct 16, 2017 2:37 am
by madis.luik
Hello
How can I can get all hosts from specific hostgroup using REST API

Re: Hostgroup hosts REST API

Posted: Mon Oct 16, 2017 12:10 pm
by dwasswa
Hi @ madis.luik,

Here is a guide that will help you achieve that:

Accessing_The_XI_Backend_API

When you test API access by visiting one of the backend URLs in a web browser.

Code: Select all

http://<>YOUR SERVER IP/nagiosxi/backend/?cmd=gethostgroups&username=nagiosadmin&ticket=uiV5saH2
XML OUTPUT:

Code: Select all

<hostgrouplist>
<recordcount>1</recordcount>
<hostgroup id="144">
<instance_id>1</instance_id>
<hostgroup_name>linux-servers</hostgroup_name>
<is_active>1</is_active>
<config_type>1</config_type>
<alias>Linux Servers</alias>
</hostgroup>
</hostgrouplist>