Service list not belonging to any group

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
nms
Posts: 222
Joined: Wed Sep 28, 2016 9:35 am

Service list not belonging to any group

Post by nms »

Hi,

We have several monitors assigned to service groups and host groups.
2019-10-04_1718.png
Is there a way to obtain (maybe via api or mysql) the list of all services which do not belong to any of these groups?

Rgds,
You do not have the required permissions to view the files attached to this post.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Service list not belonging to any group

Post by benjaminsmith »

Hello @nms,

That wouldn't be available in the standard reports. Try following sql query on the nagios database. This would be any host not belonging to a hostgroup.

To log into mysql:

Code: Select all

mysql -u root -p nagiosxi
use nagios;
SQL:

Code: Select all

 SELECT nagios_hosts.display_name FROM nagios_hosts LEFT OUTER JOIN nagios_hostgroup_members ON nagios_hosts.host_object_id = nagios_hostgroup_members.host_object_id WHERE nagios_hostgroup_members.host_object_id is NULL;
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
nms
Posts: 222
Joined: Wed Sep 28, 2016 9:35 am

Re: Service list not belonging to any group

Post by nms »

Hi,

Thank you for this. How can this be done for services that do not belong in any group?

Rgds,
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Service list not belonging to any group

Post by benjaminsmith »

Hello,

Here's an example. Similar but using the nagios_services and nagios_servicegroup_members tables. Added the host ID, but you'll need to look that up if that's needed.

Code: Select all

SELECT nagios_services.display_name, nagios_services.host_object_id FROM nagios_services LEFT OUTER JOIN nagios_servicegroup_members ON nagios_services.service_object_id = nagios_servicegroup_members.service_object_id WHERE nagios_servicegroup_members.service_object_id is NULL;
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
nms
Posts: 222
Joined: Wed Sep 28, 2016 9:35 am

Re: Service list not belonging to any group

Post by nms »

Thanks!

You may kindly close/lock this thread.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Service list not belonging to any group

Post by benjaminsmith »

Thanks!
You may kindly close/lock this thread.
Sounds good. Will close this out. Thank you for using Nagios.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked