Error in windows.cfg that I can't seem to find

Hello all–

I have Nagios 3.0b4 runnig on an Ubuntu 7 box. I followed the quickstart guide and I’m able to monitor the few printers I have set up so far and the local host.

I installed and configured NSClient++ 0.2.7 on my machine and followed the quickstart guide to set up Nagios to monitor my machine.

When I run the verify switch for Nagios (/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg) to make sure everything’s OK, I get the following:

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios 3.0b4
Copyright © 1999-2007 Ethan Galstad (nagios.org)
Last Modified: 09-27-2007
License: GPL

Reading configuration data…

Error: Could not find any hostgroup matching ‘allhosts’ (config file ‘/usr/local/nagios/etc/objects/windows.cfg’, starting on line 25)
Error: Hostgroup has no members (config file ‘/usr/local/nagios/etc/objects/windows.cfg’, starting on line 47)

The problem is, there’s no such line in my windows.cfg file:

more windows.cfg

###############################################################################

WINDOWS.CFG - SAMPLE CONFIG FILE FOR MONITORING A WINDOWS MACHINE

Last Modified: 06-13-2007

NOTES: This config file assumes that you are using the sample configuration

files that get installed with the Nagios quickstart guide.

###############################################################################

###############################################################################
###############################################################################

HOST DEFINITIONS

###############################################################################
###############################################################################

Define a host for the Windows machine we’ll be monitoring

Change the host_name, alias, and address to fit your situation

define host{
use windows-server ; Inherit default values from a template
host_name myPC ; The name we’re giving to this host
alias Joe ; A longer name associated with the host
address 192.168.1.59 ; IP address of the host
}

###############################################################################
###############################################################################

HOST GROUP DEFINITIONS

###############################################################################
###############################################################################

Define a hostgroup for Windows machines

All hosts that use the windows-server template will automatically be a member of this group

define hostgroup{
hostgroup_name windows-servers ; The name of the hostgroup
alias Windows Servers ; Long name of the group
}

###############################################################################
###############################################################################

SERVICE DEFINITIONS

###############################################################################
###############################################################################

Create a service for monitoring the version of NSCLient++ that is installed

Change the host_name to match the name of the host you defined above

define service{
use generic-service
host_name myPC
service_description NSClient++ Version
check_command check_nt!CLIENTVERSION
}

Create a service for monitoring the uptime of the server

Change the host_name to match the name of the host you defined above

define service{
use generic-service
host_name myPC
service_description Uptime
check_command check_nt!UPTIME
}

Create a service for monitoring CPU load

Change the host_name to match the name of the host you defined above

define service{
use generic-service
host_name myPC
service_description CPU Load
check_command check_nt!CPULOAD!-l 5,80,90
}

Create a service for monitoring

Change the host_name to match the name of the host you defined above

define service{
use generic-service
host_name myPC
service_description Memory Usage
check_command check_nt!MEMUSE!-w 80 -c 90
}

Create a service for monitoring C:\ disk usage

Change the host_name to match the name of the host you defined above

define service{
use generic-service
host_name myPC
service_description C:\ Drive Space
check_command check_nt!USEDDISKSPACE!-l c -w 80 -c 90
}

Create a service for monitoring the W3SVC service

Change the host_name to match the name of the host you defined above

define service{
use generic-service
host_name myPC
service_description W3SVC
check_command check_nt!SERVICESTATE!-d SHOWALL -l W3SVC
}

Create a service for monitoring the Explorer.exe process

Change the host_name to match the name of the host you defined above

define service{
use generic-service
host_name myPC
service_description Explorer
check_command check_nt!PROCSTATE!-d SHOWALL -l Explorer.exe
}

I’ve uncommented the ‘cfg_file=/usr/local/nagios/etc/objects/windows.cfg’ line in nagios.cfg

any thoughts?

Thanks,
Joe

I’m having this same problem, I can’t seem to figure out whats wrong with my files either. I noticed in yours, you defined the device you’re monitoring as windows-server, then in hostgroup_name you’re using wndows-servers. I had that at first and then changed them both to windows-server, but it didn’t fix my problem.

I think the first windows_server is just the monitoring template, not the host group… not sure though.

I’m in the process of upgrading to 3.0b5 to see if that helps. I noticed that there are some bug fixes in the config files, so what the heck…

If you find that this fixes the problem, post here with any changes you made.

Found it:
In templates.cfg, remove the ‘allhosts’ reference from the windows_server section. ran the verify with no errors, reloaded and it’s working fine.

Yup, worked for me too, thanks.

I’m still having the following error in the web interface:

Web interface gives me Error: Could not read host and service status information! when I try to go to anything under Monitoring, and most of the stuff under Reporting.

Any idea how to fix this?

did you edit the NSC.ini file on your windows machine?

I uncommented all the dlls except WMI and remote config.

Yup, did that step, uncommented the same dlls.

I know these are obvious, but…
you installed the service?
installed the systray icon?
started the service?

are you able to get reports on the nagios machine itself?

Service installed
Systray icon is there
service is started

not sure how to view the reports on the nagios machine