Could not expand members specified in hostgroup (defined in cfg_dir)

Jacob Anawalt jlanawalt at gmail.com
Fri Jan 8 17:01:46 CET 2010


Hello,

I was trying out Nagios 3.0.6-4~lenny2 on Debian 5.0. The nagios3
package in Lenny uses cfg_dir pointing at /etc/nagios3/conf.d. The
directory is pre-populated with the following:

contacts_nagios2.cfg
extinfo_nagios2.cfg
generic-host_nagios2.cfg
generic-service_nagios2.cfg
host-gateway_nagios3.cfg
hostgroups_nagios2.cfg
localhost_nagios2.cfg
services_nagios2.cfg
timeperiods_nagios2.cfg

I made a new cfg for my gecko server, gecko.cfg, and added it
alongside localhost in hostgroups_nagios2.cfg, but when I tried to
restart, nagios says:

Error: Could not find any host matching 'gecko' (config file
'/etc/nagios3/conf.d/hostgroups_nagios2.cfg', starting on line 18)
Error: Could not expand members specified in hostgroup (config file
'/etc/nagios3/conf.d/hostgroups_nagios2.cfg', starting on line 18)

I worked around the issue by removing gecko from the hostgroup members
and instead adding a hostgroups entry to the gecko host definition. I
believe the object definitions are correct because the gecko entry
with an HTTP service is now active.

What would prevent me from adding gecko to members of the hostgroup?

services_nagios2.cfg:
...
define service {
        hostgroup_name                  http-servers
        service_description             HTTP
        check_command                   check_http
        use                             generic-service
        notification_interval           0
}
...

hostgroups_nagios2.cfg:
...
define hostgroup {
        hostgroup_name  http-servers
                alias           HTTP servers
# works/original
                members         localhost
# broken
#                members         localhost,gecko
        }
...

gecko.cfg:
define host{
        use                     generic-host
        host_name               gecko.domain.tld
        alias                   gecko
        address                 nnn.nnn.nnn.nnn
# added when hostgroup.members didn't work
        hostgroups              http-servers
        }

localhost_nagios2.cfg:
define host{
        use                     generic-host
        host_name               localhost
        alias                   localhost
        address                 127.0.0.1
        }
# a few non-hostgroup service definitions follow
...

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list