Nagios. Hostgroup has no members

Posted on 2007-10-01
Last Modified: 2012-06-27
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.
Question by:paul_at_work
    LVL 4

    Accepted Solution

    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 :

    LVL 13

    Assisted Solution

    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.
    LVL 1

    Assisted Solution

    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.


    Assisted Solution

    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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Currently, there is not an RPM package available under the RHEL/Fedora/CentOS distributions that gives you a quick and easy way to allow PHP to interface with Oracle. As a result, I have included a set of instructions on how to do this with minimal …
    Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now