[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Nagios. Hostgroup has no members

Posted on 2007-10-01
6
Medium Priority
?
2,652 Views
Last Modified: 2012-06-27
Hi
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.
0
Comment
Question by:paul_at_work
4 Comments
 
LVL 4

Accepted Solution

by:
avatech earned 500 total points
ID: 19991953
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 :

http://nostarch.com/frameset.php?startat=nagios

0
 
LVL 13

Assisted Solution

by:WizRd-Linux
WizRd-Linux earned 500 total points
ID: 19995212
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.
0
 
LVL 1

Assisted Solution

by:mhenwood
mhenwood earned 500 total points
ID: 20566560
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.

Mark
0
 

Assisted Solution

by:jkingsol1
jkingsol1 earned 500 total points
ID: 21503650
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
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month18 days, 9 hours left to enroll

826 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