Cannot expand member hosts in hostgroups.cfg


#1

I had Nagios configured with 3 servers and it was running fine, I then added my other servers and I kept getting an error.

I have removed all the old config files and recreated new ones with only one server and one service, I’m still getting the same error. I’m posting both the error and the config files.
Thanks for the help

Nagios 2.4
Copyright © 1999-2006 Ethan Galstad (nagios.org)
Last Modified: 05-31-2006
License: GPL

Reading configuration data…

Error: Could not find any host matching 'fmsunagios’
Error: Could not expand member hosts specified in hostgroup (config file ‘/usr/local/nagios/etc/hostgroups.cfg’, starting on line 2)

***> One or more problems was encountered while processing the config files…

Hosts.cfg
#define host{
name generic-host
register 0
check_command check-host-alive
max_check_attempts 3
check_period 24x7
contact_groups localadmins
notification_interval 60
notification_period 24x7
notification_options d,u,r,f
}

define host{
name fmsunagios
use generic-host
hostgroups all-servers
alias Monitoring Server
address fmsunagios.fujimed.com
}

#Hostgroups.cfg
define hostgroup{
hostgroup_name all-servers
alias All Servers
members fmsunagios
}

#Services.cfg
define service{
service_description PING
check_command check_ping!100.0,20%!500.0,60%
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
check_period 24x7
notification_interval 60
notification_period 24x7
notification_options w,u,c,r,f
contact_groups localadmins
host_name fmsunagios
}

#Servicegroups.cfg
define servicegroup{
servicegroup_name all-ping
alias All ping
members fmsunagios,PING
}


#2

The host name line hould read:
host_name fmsunagios,


#3

GrahamA,

Thanks for the feed back. I resolved the issue by eliminating the hostname’s from the hostgroups and adding the hostgroup name to the host.cfg.

Much cleaner and I only need to edit one file ( as long as all the basic hostgroups are defined with no hostname).


#4

Servicegroups work too. I have a couple of installations since 1.2 and the templated config is certainly the way to go. Whether or not one huge file containing everything is a good thing, I’m not sure.


#5

“Hosts.cfg
#define host{”

That is NOT the correct way to start out your hosts.cfg file. It should be:

define host{
name generic-host
check_command check_host


#6

The # char is a typo, I did resole the issue.

Thanks.