duplicate definition found

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
schemelab
Posts: 3
Joined: Wed Oct 20, 2010 12:38 am

duplicate definition found

Post 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

       }

schemelab
Posts: 3
Joined: Wed Oct 20, 2010 12:38 am

Re: duplicate definition found

Post 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
schemelab
Posts: 3
Joined: Wed Oct 20, 2010 12:38 am

Re: duplicate definition found

Post by schemelab »

yeah that's what it was. wish I could delete this whole thread :)
Locked