Nagios 3 configuration problem

I am new with Nagios, I am trying to configure it to monitor a windows machine. I have installed the suitable client on the windows machine.
I have been following all the instructions on the Nagios Documentation.
When I write the command (./nagios -v /opt/local/nagios-3.0/etc/objects/windows.cfg)
it gives me the following error
Reading configuration data…

Error in configuration file ‘/opt/local/nagios-3.0/etc/objects/windows.cfg’ - Line 25 (NULL value)

***> The name of the main configuration file looks suspicious…

 Make sure you are specifying the name of the MAIN configuration file on
 the command line and not the name of another configuration file.  The
 main configuration file is typically '/usr/local/nagios/etc/nagios.cfg'

***> One or more problems was encountered while processing the config files…

 Check your configuration file(s) to ensure that they contain valid
 directives and data defintions.  If you are upgrading from a previous
 version of Nagios, you should be aware that some variables/definitions
 may have been removed or modified in this version.  Make sure to read
 the HTML documentation regarding the config files, as well as the
 'Whats New' section to find out what has changed.

Here is the line that the error is referring to

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

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{ <<<<<<<<<Line 25
use windows-server1 ; Inherit default values from a template
host_name windows ; The name we’re giving to this host
alias My Windows Server ; A longer name associated with the host
address 10.237.160.19 ; IP address of the host
}

Hi

You need to point it at the main configuration file, nagios.cfg… that is where you configure your files/directories you are using that contain your object definitions, so it will then know to inspect the configuration within your windows.cfg file

HTH

/S

Strides,
Thanks a lot for your reply.

I have already edited the nagios.cfg and un-hashed the windows.cfg file but still I am facing the problem.
any other tip to try :slight_smile:

Sorry, perhaps I should have made that a bit clearer, I was refering to the pre-flight check you are running, i.e.

./nagios -v ...

That needs to point to your main configuration file, nagios.cfg. You can’t point it at an object definition file, as stated:
[blockquote]
***> The name of the main configuration file looks suspicious…

Make sure you are specifying the name of the MAIN configuration file on
the command line and not the name of another configuration file. The
main configuration file is typically ‘/usr/local/nagios/etc/nagios.cfg’
[/blockquote]
Try using

/nagios -v /opt/local/nagios-3.0/etc/nagios.cfg

instead

HTH

/S