Created Host Groups But Getting Configuration Error

This board serves as an open discussion and support collaboration point for Nagios XI. NOTE: Nagios XI customers should use the Customer Support forum to obtain expedited support.

Created Host Groups But Getting Configuration Error

Postby Ben.Patrick » Fri Mar 11, 2011 9:16 am

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
Ben.Patrick
 
Posts: 10
Joined: Thu Mar 10, 2011 5:26 am

Re: Created Host Groups But Getting Configuration Error

Postby admin » Fri Mar 11, 2011 7:56 pm

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.
Ethan Galstad
President
User avatar
admin
Site Admin
 
Posts: 259
Joined: Mon Oct 12, 2009 8:21 am

Re: Created Host Groups But Getting Configuration Error

Postby Ben.Patrick » Sat Mar 12, 2011 8:27 am

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.
Ben.Patrick
 
Posts: 10
Joined: Thu Mar 10, 2011 5:26 am

Re: Created Host Groups But Getting Configuration Error

Postby Box293 » Mon Mar 14, 2011 4:36 am

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).
User avatar
Box293
Too Basu
 
Posts: 4739
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia

Re: Created Host Groups But Getting Configuration Error

Postby Ben.Patrick » Mon Mar 14, 2011 6:22 am

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

Postby Ben.Patrick » Mon Mar 14, 2011 8:37 am

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.
Ben.Patrick
 
Posts: 10
Joined: Thu Mar 10, 2011 5:26 am

Re: Created Host Groups But Getting Configuration Error

Postby rdedon » Mon Mar 14, 2011 9:59 am

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
rdedon
 
Posts: 579
Joined: Sat Nov 20, 2010 4:51 pm


Return to Nagios XI

Who is online

Users browsing this forum: Yahoo [Bot] and 11 guests