Unable to Delete BPI Group

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
wneville
Posts: 113
Joined: Wed Mar 31, 2021 3:35 pm

Unable to Delete BPI Group

Post by wneville »

Hello,

I have no recollection of the 'Hostgroups' and 'Servicegroups' tabs being present under BPI, but it appears someone at some point created BPI groups under these tabs. It doesn't appear that the BPI recognizes when a host or service is deleted. I want to remove these BPI groups altogether, but when I click delete, I get "Groups Deleted: 0 Unable to match string in config file." How can I remove this BPI group? It is evident that BPI doesn't recognize when things have been deleted because when I go into the BPI config screen there are blanks. When I delete the blanks and click Write Configuration, I get "Error: Unable to match string in config file."

Please advise, it doesn't appear there is any clean way to remove these.

Another question, would these had to have been user created?
bbahn
Posts: 385
Joined: Thu Jan 12, 2023 5:42 pm

Re: Unable to Delete BPI Group

Post by bbahn »

Hello @wneville,

The Hostgroup and Servicegroup tabs are not user-created. You should be able to re-sync these by hitting the Sync Hostgroups/Sync Servicegroups buttons. This does seem to be an issue, though as you cannot re-sync without losing any changes made to the page. If you'd like, I can file a feature request to enhance this feature to maintain changes across re-syncs.
Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.
wneville
Posts: 113
Joined: Wed Mar 31, 2021 3:35 pm

Re: Unable to Delete BPI Group

Post by wneville »

Is it possible to turn off/disable the Hostgroup and Servicegroup tabs in BPI? It only has one Servicegroup and a few Hostgroups (not all of them) and we are not using these tabs at this time.

I see there are two options in BPI settings for "Sync on Apply Config" - it appears the "Remove missing hosts and services from all groups" option is not working as intended (if I correctly understand what the intended behavior is). Would unchecking "Sync all hostgroups and servicegroups on apply config" stop the error messages I am seeing in cmdsubsys.log? Since I noticed these messages appearing I also noticed that Apply Config is giving RETURNCODE=7 - not sure if that is an issue or not.
bbahn
Posts: 385
Joined: Thu Jan 12, 2023 5:42 pm

Re: Unable to Delete BPI Group

Post by bbahn »

If the "Remove missing hosts and services from all groups" functionality isn't working on the hostgroups/servicegroups sections, then I think it was most likely an oversight by whoever made them. Since it sounds like you are receiving errors and you aren't using these sections, can you try deleting the BPI Hostgroups/Servicegroups on those pages and see if that resolves the error? I will file a bug report for the missing hosts/services not being removed from hostgroups/servicegroups.

Could you also post the error that is being broadcast in cmdsubsys.log, so that we can diagnose and create a bug report for it?
Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.
wneville
Posts: 113
Joined: Wed Mar 31, 2021 3:35 pm

Re: Unable to Delete BPI Group

Post by wneville »

Do you happen to know what version added Hostgroups and Servicegroups to the BPI? Is there a plan to fix the functionality of the "remove missing hosts and services from all groups" button in the next nagios release?

As I mentioned in my original post, I want to remove these BPI groups altogether, but when I click delete, I get "Groups Deleted: 0 Unable to match string in config file." : )
bbahn
Posts: 385
Joined: Thu Jan 12, 2023 5:42 pm

Re: Unable to Delete BPI Group

Post by bbahn »

Ah, that's right. Can you post the error that you are receiving in your cmdsubsys.log so that we can fix that?

Also, in the mean-time since you are unable to delete them via the delete button, can you try deleting them manually? This can be done by going to the folder icon next to the settings icon and selecting edit config, removing the hostgroups/servicegroups and then saving.
Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.
wneville
Posts: 113
Joined: Wed Mar 31, 2021 3:35 pm

Re: Unable to Delete BPI Group

Post by wneville »

Here is the cmdsubsys.log excerpt when I apply config:

Code: Select all

Unable to match string in config file.Member: [Hostname];[Service name] removed!
Unable to match string in config file.CMD: syncall
MSG: Groups Deleted: 0 Unable to match string in config file.Groups Deleted: 0 Unable to match string in config file.Groups Deleted: 0 Unable to match string in config file.Groups Deleted: 0 Unable to match string in config file.Groups Deleted: 0 Unable to match string in config file.Groups Deleted: 0 Unable to match string in config file.BPI configuration applied successfully! Groups Deleted: 0 Unable to match string in config file.BPI configuration applied successfully!
Wed, 23 Oct 2024 12:11:51 -0400 OUTPUT=MSG: Groups Deleted: 0 Unable to match string in config file.Groups Deleted: 0 Unable to match string in config file.Groups Deleted: 0 Unable to match string in config file.Groups Deleted: 0 Unable to match string in config file.Groups Deleted: 0 Unable to match string in config file.Groups Deleted: 0 Unable to match string in config file.BPI configuration applied successfully! Groups Deleted: 0 Unable to match string in config file.BPI configuration applied successfully!
Wed, 23 Oct 2024 12:11:51 -0400 RETURNCODE=7
The first line: "Unable to match string in config file.Member: [Hostname];[Service name] removed!" appears once for every host/service that has been removed, so there are tons of lines for that type of entry.

I was able to successfully remove the host and servicegroups from the edit config within the folder icon. Not sure why, but there were multiple entries for each host and service group that appeared in the BPI screen. Also, the web file editor had tons and tons of white space/newlines. I compared this to /usr/local/nagiosxi/etc/components/bpi.conf, and noted that bpi.conf has 49 lines of text but 153 lines in the file. The web file editor must have had 1000 whitespace lines/newlines in it, which I thought was odd.

I suppose we can mark this as resolved with the resolution being a manual removal of the host and service groups from BPI via the Folder icon in the BPI screen - though it felt odd that this appeared on its own, didn't stay up to date, and then was unable to be removed via delete buttons
Fooked1942
Posts: 1
Joined: Thu Oct 24, 2024 10:30 pm

Re: Unable to Delete BPI Group

Post by Fooked1942 »

Navigate to the BPI configuration file, typically located at /usr/local/nagiosxi/etc/components/bpi.conf. Check for any entries related to the group you want to delete. If automatic deletion does not work, you may need to manually delete entries from the bpi.conf file. Back up your configuration file before making any changes.
wneville
Posts: 113
Joined: Wed Mar 31, 2021 3:35 pm

Re: Unable to Delete BPI Group

Post by wneville »

All of the hostgroup BPIs have been automatically regenerated. How can I disable this? The whole hostgroups/servicegroups BPI feature doesn't seem to be working as intended and I'm not going to manually edit the bpi.conf file every time I remove a host/service
bbahn
Posts: 385
Joined: Thu Jan 12, 2023 5:42 pm

Re: Unable to Delete BPI Group

Post by bbahn »

I believe they should only be regenerated if you click the buttons to sync them. If this is not the case, I can file a bug report for it to work properly.
You should be able to delete them and so long as nobody clicks the button, they shouldn't regenerate.
Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.
Post Reply