Page 1 of 3

Warning: Duplicate definition found for service (HELP))

Posted: Thu Jun 06, 2013 4:03 pm
by Technology_Vacation
Hi Team,

I am receiving tons of error messages, its not causing an issue to the GUI or command line, however not sure if it will cause a problem in the long run.

Warning: Duplicate definition found for service 'Check Memory' on host '' (config file '/usr/local/nagios/etc/services/.cfg', starting on line 147)
Warning: Duplicate definition found for service 'Ping' on host '' (config file '/usr/local/nagios/etc/services/.cfg', starting on line 311)
Warning: Duplicate definition found for service 'Check Zombie Processes' on host 'T' (config file '/usr/local/nagios/etc/services/.cfg', starting on line 293)
Warning: Duplicate definition found for service 'Check Users' on host '' (config file '/usr/local/nagios/etc/services/.cfg', starting on line 275)
Warning: Duplicate definition found for service 'Check Total Processes' on host '' (config file '/usr/local/nagios/etc/services/.cfg', starting on line 255)
Warning: Duplicate definition found for service 'Check Memory' on host '' (config file '/usr/local/nagios/etc/services/, starting on line 220)
Warning: Duplicate definition found for service 'Check Load' on host '' (config file '/usr/local/nagios/etc/services/', starting on line 202)
Warning: Duplicate definition found for service 'Check LDAP on PORTAL.PROD' on host '' (config file '/usr/local/nagios/etc/services/', starting on line 182)

Any assistance would be greatly appreciate as to whats causing this problem.. .

Re: Warning: Duplicate definition found for service (HELP))

Posted: Thu Jun 06, 2013 4:09 pm
by abrist
Most often this type of behavior can be attributed to a hostgroup and/or servicegroup memerbship. If you have checks set up directly for the host in the host's config, be careful that the host is not also inheriting checks from a hostgroup or servicegroup with the same checks configured.

Re: Warning: Duplicate definition found for service (HELP))

Posted: Fri Jun 07, 2013 12:05 pm
by Technology_Vacation
Thank you,

Is it possible to provide step by step instructions on how to investigate this problem and resolve? and how to prevent it from happening moving forward?

Re: Warning: Duplicate definition found for service (HELP))

Posted: Fri Jun 07, 2013 12:46 pm
by abrist
The warning are oddly formatted, as it appears you do not have hostnames on these checks:
Warning: Duplicate definition found for service 'Check Memory' on host '' (config file '/usr/local/nagios/etc/services/.cfg', starting on line 147)
Notice the bolded pair of single quotes? There should be a hostname between those quotes. Did you remove the hostname in an effort to obfuscate for the post, or were these lines copied verbatim?
If you are not worried about exposing your config to these forums, I would suggest posting your service configuration in code wraps.

Re: Warning: Duplicate definition found for service (HELP))

Posted: Fri Jun 07, 2013 12:54 pm
by Technology_Vacation
yes I removed the Hostname....

So for example it will be abc.xxx.com its the same for the entire output provided..

Re: Warning: Duplicate definition found for service (HELP))

Posted: Fri Jun 07, 2013 1:04 pm
by abrist
I would check the templates and hostgroups associated with the host. Make sure the services are only defined once. This is no exact method for hunting down these types of config issues. I prefer to separate hosts configs into individual file as it make hunting down config issues a bit easier.

Re: Warning: Duplicate definition found for service (HELP))

Posted: Fri Jun 07, 2013 1:46 pm
by Technology_Vacation
Templates -checked
hostgroup-checked
Service- is only defined once..

However located the error message it states in /usr/local/nagios/etc/services/abc.juniper.com.cfg starting on line 141. I decided to go in the path /usr/local/nagios/etc/services

If i were to run the command as listed below for the problematic servers.

[TechnologyVacation@Nagios1]$ ll ABC*
-rw-r--r--. 1 apache nagios 12442 Jun 7 14:15 abc.juniper.com.cfg
-rw-r--r--. 1 apache nagios 12442 Jun 7 14:15 ABC.JUNIPER.COM.cfg

It shows a duplicate cfg file , one lower/UPPER Case.. So what could be causing this to happen? how to remove and prevent from this problem from persisting..

Re: Warning: Duplicate definition found for service (HELP))

Posted: Fri Jun 07, 2013 2:51 pm
by sreinhardt
I just want to be 100% certain, since I rarely have seen this as a manual configuration issue. Are you on Nagios Core or Nagios XI? Also which specific version? Otherwise, can you compare the two files, are there any configuration similarities other than capitalization? Are there any service checks with the same name?

Re: Warning: Duplicate definition found for service (HELP))

Posted: Fri Jun 07, 2013 3:02 pm
by Technology_Vacation
Nagios XI 2012R1.6

When I run a diff on both the lower & Uppercase file ( there is no difference )

Possible bug?

Re: Warning: Duplicate definition found for service (HELP))

Posted: Fri Jun 07, 2013 3:05 pm
by slansing
Moved this to the Nagios Xi section, since you posted in Core. Are all of your services displaying this problem? I believe there was a bug related to this, I'll check up on that awaiting your reply.