Delete all empty hostgroup or servicegroups Nagios Core

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jwassouf
Posts: 1
Joined: Fri Apr 30, 2021 12:36 am

Delete all empty hostgroup or servicegroups Nagios Core

Post by jwassouf »

Hi All,

We are currently using Nagios® Core™ Version 4.4.5 and we are using NagiosQL 3.4.1 to help us manage and configure our config checks.

Our hostgroup or servicegroups is very messy at the moment and I am looking to clean things up, currently I am looking to delete all empty configs that have nothing attached to them at all.

Is there a way to list all empty hostgroup or servicegroups? maybe an API or query that I can use?

Thank you in advance.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Delete all empty hostgroup or servicegroups Nagios Core

Post by benjaminsmith »

Hi,

Thanks for contacting the Nagios Support Team. This forum is for Nagios XI, however, you can post your question to the Nagios Community Forum for help. at:

https://support.nagios.com/forum/viewforum.php?f=7

Best Regards,
Benjamin
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!
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: Delete all empty hostgroup or servicegroups Nagios Core

Post by gsmith »

Hi,

Go to /usr/local/nagios/etc and take a look at:
servicegroups.cfg
hostgroups.cfg

You could copy them to /tmp or download them so you could edit
them in order to keep track of the changes you make via the gui.

Thanks
Locked