Hello,
What is the query to obtain hosts in a determinate hostgroup.
Thanks
SQL Queries to DB Nagios
Re: SQL Queries to DB Nagios
You can get this information from the API. To find the command you can go to Help > API Docs > Objects Reference > Group Members > objects/hostgroupmembers. The command would look something like:
Code: Select all
curl -XGET "http://XI_ADDRESS/nagiosxi/api/v1/objects/hostgroupmembers?apikey=<API_KEY>&pretty=1&hostgroup_name=HOSTGROUPNAME"As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
FCC_Nagios_Support
- Posts: 161
- Joined: Tue Mar 10, 2020 11:07 am
Re: SQL Queries to DB Nagios
Many Thanks Sir.
But do you now de SQL Query?
Thanks again
But do you now de SQL Query?
Thanks again
Re: SQL Queries to DB Nagios
WARNING: We do not recommend that you interact directly with the nagios databases. If you write to the DB directly and it causes issues it will not be supported. You should use the API whenever possible.
You can look in this file:
Search for this and you'll see the query it uses:
You can look in this file:
Code: Select all
/usr/local/nagiosxi/html/db/queries.inc.phpCode: Select all
// HOSTGROUP MEMBERS