Find Out Services without Service group assigned

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
adminskymed
Posts: 19
Joined: Tue Feb 20, 2018 5:40 am

Find Out Services without Service group assigned

Post by adminskymed »

Hi All,

i need to check if someone of my services has been not assigned to any servicegroup in Nagios XI.
Is there an easy way to do that? without check any single services obviously (i have 7000 services)
Basically I have some service group like:

CPU
Interface Status
Bandwidth
Memory
ecc ecc

If I make the sum of the services in all this service group, I get a number that is less of the number of all services taken from Nagiosxi Service Status Summary. So It means that I forgot to assign the service group to some services, and I need to find this services to correct my mistake.

Thanks
Alex
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Find Out Services without Service group assigned

Post by npolovenko »

Hello, @adminskymed. Unfortunately, there is no such functionality. You could build your own script that pulls services and service groups from the database and compares them, but this is something outside of the regular support scope.

You may try the following DB query to see services without service groups but it will only work in some instances(maybe worth a try anyway):
echo "SELECT service_description FROM tbl_service WHERE servicegroups=0;" | mysql -u root -pnagiosxi nagiosql
Otherwise, you'd have to come up with some more complicated query that looks at the tables, links between tables and matches them.
echo "SELECT * from tbl_lnkServicegroupToService;" | mysql -u root -pnagiosxi nagiosql
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
adminskymed
Posts: 19
Joined: Tue Feb 20, 2018 5:40 am

Re: Find Out Services without Service group assigned

Post by adminskymed »

Thanks for your reply.

I found out a problem in the nagiossql database.
Basically if I add a service to servicegroup from service configuration page in nagiosxi than I can see "servicegroup" number in tbl_service changes,
but if I add a service to servicegroup from service group configuration page in nagiosxi, serviegroup field in tbl_service doesn't change.
I think it is a bug. I hope it could be solved in some way.

Ale
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Find Out Services without Service group assigned

Post by npolovenko »

@adminskymed, There are different tables for services assigned to service groups from the service settings and from service groups. The other table can be also found in the nagiosql database but its more complicated because it uses links and you'd need to combine information from multiple tables at once.
echo "SELECT * FROM tbl_lnkServicegroupToService;" | mysql -u root -pnagiosxi nagiosql
echo "SELECT * FROM tbl_lnkServiceToServicegroup;" | mysql -u root -pnagiosxi nagiosql
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked