Ghost in the hostgroup.cfg file

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
sborne
Posts: 5
Joined: Wed Apr 23, 2014 10:57 am

Ghost in the hostgroup.cfg file

Post by sborne »

Hello,

Using Nagiosxi

We are having an issue trying to Apply Configuration. After deleting a hostgroup the reload errors out on an issue with "Error: Could not expand members specified in hostgroup (config file '/usr/local/nagios/etc/hostgroups.cfg', starting on line 230) Error processing object config files!".

The line 230 is the definition of a host group that has been deleted. Tried to remove/comment out the host group definition but the Apply Configuration puts the info back in hostgroups.cfg.

Removed the hosts in the host group thinking that was causing the error, still fails. Both the hostgroup and hosts are removed and not found in the interface but show up in the actual cfg file.

Then tried to reload the hosts and hostgroup through the Nagiosxi interface but cannot as the Apply Config still fails.

We also rolled the config back to the last working config and still receive the error.

Any ideas?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Ghost in the hostgroup.cfg file

Post by slansing »

Looks like the host or group in that config file is still present in the current instance of Nagios, which means that you should still be able to find it in the CCM and remove it. As all of the config files state at the top, editing them by hand will do nothing, as Nagios XI will pull the database info and replace it in the config file if it is still present in the DB.
sborne
Posts: 5
Joined: Wed Apr 23, 2014 10:57 am

Re: Ghost in the hostgroup.cfg file

Post by sborne »

Thanks for your quick reply.

I have checked the CCM and the entry is not available. I have also searched the CCM for hosts associated with this host group and they are no longer in the CCM but do show up in the config file. Tried to add the missing info back into the CCM to no avail. I have called support and the support rep mentioned this was a known issue. Our Director is off on leave so we are unable to renew our support contract until he gets back.

All help greatly appreciated.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Ghost in the hostgroup.cfg file

Post by tmcdonald »

This sounds like a case of the Ghost Hosts: http://support.nagios.com/wiki/index.ph ... t_Hosts.29

Basically, something might be gone from the CCM but be present on the file system, and you need to go in to the command line and remove the offending file manually.

Also, I moved your thread to the Nagios XI forum - you had it in Nagios Core.
Former Nagios employee
sborne
Posts: 5
Joined: Wed Apr 23, 2014 10:57 am

Re: Ghost in the hostgroup.cfg file

Post by sborne »

Hello,

Followed the directions in the support article and also deleted the offending host from /usr/local/nagios/etc/hosts. Wrote the config file and it will still not pass verification.

Getting a slightly different error:
Error: Could not expand members specified in hostgroup (config file '/usr/local/nagios/etc/hostgroups.cfg', starting on line 235)
Error processing object config files!

The line in hostgroups.cfg is:

define hostgroup {
hostgroup_name external-testers
alias external-testers
members li258-182.members.linode.com
notes External sustem for running nrpe checks
}
<---- line 235

The host I manually removed was li258-182.members.linode.com

Neither external-testers nor li258-182.members.linode.com are available in hte CCM

Restarted mysql,nagios and nagiosxi.

Is there a way to delete the hostgroup definition from the db? Would that solve the error?
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Ghost in the hostgroup.cfg file

Post by sreinhardt »

Could you pm one of use either a config snapshot or profile.zip? This would be far easier if we had a look at the configs and knew what you wanted to remove.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Ghost in the hostgroup.cfg file

Post by sreinhardt »

Based on the error you sent me in the pm, and the config snapshot. You have a host fhwebmail_wms listed in that same named hostgroup, that does not exist in any other configuration. Removing that via CCM from being a member of the group or that hostgroup entirely should resolve the presently listed issue.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
sborne
Posts: 5
Joined: Wed Apr 23, 2014 10:57 am

Re: Ghost in the hostgroup.cfg file

Post by sborne »

Hello,

That has created a cascading error:

Error: Could not find any hostgroup matching 'external-testers' (config file '/usr/local/nagios/etc/services/linode_check_idx.cfg', starting on line 14)
Error processing object config files!

Removed all hosts connected to the external-check. Both linode_check_idx and external-testers do not exist in the CCM but still error on the config reload. Reloading from a good Configuration Snapshot now has the same error.

Looking to the error in mysql reloading the broken/missing/not there config.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Ghost in the hostgroup.cfg file

Post by abrist »

Are any of the config files older than the rest?

Code: Select all

ls -lat /usr/local/nagios/etc/hosts/ | tail -15
ls -lat /usr/local/nagios/etc/services/ | tail -15
If so, they are most likely the culprit as the old files are most likely the ghost files.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
sborne
Posts: 5
Joined: Wed Apr 23, 2014 10:57 am

Fixed: Ghost in the hostgroup.cfg file

Post by sborne »

FIXED: Rolled back through the snapshots (10 or so) until I found one that verified correctly with "Apply Configuration" and reinitialized any missing changes.

Thanks to all that helped.
Locked