Nagios. Hostgroup has no members

I am new to Nagios and have installed version 3.0b3 on Ubantu with NSClient++ on windows machine to monitor my xp machine.
Having gone through all the steps in the online documentation i get an error when i run verification on my configuration files saying ' Error: Hostgroup has no members (config file '/usr/localnagios/etc/objects/windows.cfg, starting on line 47)'

I have rechecked the windows.cfg file but cannot source anything.

can anyone please help.
Who is Participating?
It sounds like you have an empty hostgroup definition in the file windows.cfg at line 47.  Depending on how you structured your Nagios this would be a little cumbersome to diagnose, especially if it's using a single file to construct all of the configurations.

First start would be if you could paste line 47 from /usr/localnagios/etc/objects/windows.cfg

Then take a look at all of your host definitions.  They should look similar to this:
define host {
        host_name       [hostname of machine]
        hostgroups      [hostgroup assigned]
        alias           [Display alias]
        address         x.x.x.x
        check_command   check-host-alive
        max_check_attempts      3
        check_period    24x7
        contact_groups  localadmins
        notification_interval   120
        notification_period     24x7
        notification_options    d,u,r,f

If in your host definition you do not have a "hostgroups" entry, search your files for the definition of the hostgroups available, then assign the hosts to that hostgroup.  Be sure to backup the files before you make any changes to them.

I found that using the Ubuntu pre-compiled version of Nagios was nifty, but ultimately did my own from source with this guide :

Find the definition close to this:

define hostgroup{
        hostgroup_name  XPMachines
        alias   XP

Then in your host definition make sure you have the line:

hostgroups XPMachines

Basically what you need to make sure is what ever you have after hostgroup_name is the same in the hostgroups part of your host configuration.
1) The nagios install defines a few host groups within its initial files.  If you grep the config files on the server you can find the groups that are defined in different files.  Some of them have a "members" line and others don't.  It is not clear to me whether having the same host group defined in more than one file is allowed so here is what I did.
- Commented out all the group definitions in the various files.
- Copied these to a file I called hostgroups.cfg and commented out the groups I am not using yet.
- Made sure nagios would read the new file and the owner/permissions were correct.
- Restarted the service, probably could have HUPed.
2) In the commands.cfg file the command definition for check_nt has a -p instead of a -s for the password.  Unless this is changed you will be able to tell the host is active (it uses ping) but not anything about is present condition.

I ran into the same issue a couple weeks ago when I tried breaking up my nagios environment into like groups of hosts and servers. The key files will be the windows.cfg and the templates.cfg. The default name for a host in the windows.cfg file is windows-server. When you create a new hostgroup in templates.cfg the name you define must match the name in the USE line of the host definitions section of windows.cfg
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.