Page 1 of 1

duplicate definition found

Posted: Wed Oct 20, 2010 3:01 pm
by schemelab
I'm trying to add monitoring for a windows server as documented here: http://nagios.sourceforge.net/docs/3_0/ ... ndows.html

If you notice both the

Code: Select all

 define host 
and

Code: Select all

 define service
directives use a

Code: Select all

 host_name winserver
expression.

I used two similar directives in my config, but when I check my configuration, I am told:

Code: Select all

Warning: Duplicate definition found for host 'awswinserver' (config file '/etc/nagios3/conf.d/generic-host_nagios2.cfg', starting on line 21)
Error: Could not add object property in file '/etc/nagios3/conf.d/generic-host_nagios2.cfg' on line 25.
   Error processing object config files!
My exact directives are below:

Code: Select all

define host{

       use              windows-server  ; Inherit default values from a Windows server template (make sure you keep this line!)

       host_name                        awswinserver

       alias                                    Windows Server

       address                  20.146.127.67

       }

define service{

       use                      generic-service

       host_name                                awswinserver

       service_description                      NSClient++ Version

       check_command                                       check_nt!CLIENTVERSION

       }


Re: duplicate definition found

Posted: Wed Oct 20, 2010 3:11 pm
by schemelab
actually, I think I am including the same file twice. With ubuntu, there is no windows.cfg file to include for windows configuration.

I substituted generic-host_nagios2.cfg in that place in the main config file, which I think is including it twice.

so actually, there should be a duplicate include error

Re: duplicate definition found

Posted: Wed Oct 20, 2010 3:18 pm
by schemelab
yeah that's what it was. wish I could delete this whole thread :)