Page 1 of 1

Query to retrieve services tied to a host

Posted: Fri Sep 04, 2015 7:25 am
by brdr
Morn,

We have XI 2014R2.7.

We are restructuring the way we do services checks. We are just about completed and i would like to run a query against the database that returns the number of services tied to each host. We have approx 1,500 hosts (windows,linux). We have a specific number of service checks for each type of hosts and need to confirm that each has this number of checks. To do this via the XI Gui we take for eva'.

Could you help?

Thx

Re: Query to retrieve services tied to a host

Posted: Fri Sep 04, 2015 11:06 am
by ssax
I've whipped up a quick script for you, download the attached file, unzip it, and place it on your XI server.

Now go into Admin > Manage Components > Backend API URL > Settings
- Select the nagiosadmin user and click apply settings.
- Under the services URL, copy the entire URL and replace the URL in the file.
api_url_services.png
- Now run the script:

Code: Select all

chmod +x hosts_with_service_count.php
./hosts_with_service_count.php
hosts_with_service_count.zip

Re: Query to retrieve services tied to a host

Posted: Fri Sep 04, 2015 12:31 pm
by brdr
Awesome. thanks Mr. SSAX. Please close.