Created Host Groups But Getting Configuration Error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Ben.Patrick
Posts: 10
Joined: Thu Mar 10, 2011 5:26 am

Created Host Groups But Getting Configuration Error

Post by Ben.Patrick »

Looking for some pointers in the right direction please.

I've been creating a batch of meaningful host groups so that I can group relevant hosts together for reporting purposes.

After spending the time typing all the groups into the Nagios XI interface, when I try to apply configuration it fails. The Log shows this message
Error: Could not expand members specified in hostgroup (config file '/usr/local/nagios/etc/hostgroups.cfg', starting on line 216)
I have looked into the /usr/local/nagios/etc/hostgroups.cfg file and it only shows the hostgroups from the current active config in NagiosXI and not the version in the Core.

Could it be that Nagios is limited by size of field or certain characters in the field? A sample hostgroup name is:
Production - Plant Equipment - Threading Line
I also have hostgroups embedded in other hostgroups to form a tree of about three levels.

Any help would be appreciated, thanks in advance.

Ben
User avatar
admin
Site Admin
Posts: 256
Joined: Mon Oct 12, 2009 8:21 am

Re: Created Host Groups But Getting Configuration Error

Post by admin »

Hi Ben -

In order to see the offending statements, you'd have to go to the admin section of the XI interface and select the "Config snapshots" option. The latest error snapshot will contain the config file with the problems.

If Nagios XI detects a config problem when you try to restart it, it rolls back to the last known good config files. That's why you don't see it in the current file.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Ethan Galstad
President
Ben.Patrick
Posts: 10
Joined: Thu Mar 10, 2011 5:26 am

Re: Created Host Groups But Getting Configuration Error

Post by Ben.Patrick »

Thanks for the reply. Went through the snapshot and it was erroring out anytime I had a hostgroup with hostgroup members. Removed all the hostgroup members and the snapshot successfully applied.

I've now gone back in to add the hostgroup members and it still errors out. The message is:
Error: Could not expand members specified in hostgroup (config file '/usr/local/nagios/etc/hostgroups.cfg', starting on line 54)
Line 54 contains the following string:
define hostgroup {
hostgroup_name Location - Bellshill - Plant - Coat And Mark
alias Location - Bellshill - Plant - Coat And Mark
hostgroup_members Production - Plant Equipment - Coat And Mark
}
The hostgroup member is contained in the file at lines 130-133.

Any help would be greatly appreciated.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Created Host Groups But Getting Configuration Error

Post by Box293 »

From what I understand, a hostgroup can have no members.

However if that hostgroup is a member of another group then it must contain members (otherwise you get the errors you experienced).
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Ben.Patrick
Posts: 10
Joined: Thu Mar 10, 2011 5:26 am

Re: Created Host Groups But Getting Configuration Error

Post by Ben.Patrick »

Ah gotcha. Thanks Box 293, I'll try populating the Hostgroups with hosts and see how that goes. I was just trying to get the structure sorted out before putting the hosts in the groups. Will give it a try and let you know. Thanks, Ben
Ben.Patrick
Posts: 10
Joined: Thu Mar 10, 2011 5:26 am

Re: Created Host Groups But Getting Configuration Error

Post by Ben.Patrick »

Just to confirm that it worked. I added a host into the embedded host group. Saved config. Then embedded the hostgroup within the parent hostgroup and saved config.

All works 100%. Thanks very much.
rdedon
Posts: 578
Joined: Sat Nov 20, 2010 4:51 pm

Re: Created Host Groups But Getting Configuration Error

Post by rdedon »

Thanks for the update and feel free to post here again if you have any questions or issues. :-)
Rene deDon
Technical Team
___
Nagios Enterprises, LLC
Web: http://www.nagios.com
Locked