Warning: Duplicate definition found for service (HELP))

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Technology_Vacation
Posts: 22
Joined: Thu Mar 21, 2013 9:07 am

Warning: Duplicate definition found for service (HELP))

Post 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.. .
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Technology_Vacation
Posts: 22
Joined: Thu Mar 21, 2013 9:07 am

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

Post 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?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Technology_Vacation
Posts: 22
Joined: Thu Mar 21, 2013 9:07 am

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

Post 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..
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Technology_Vacation
Posts: 22
Joined: Thu Mar 21, 2013 9:07 am

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

Post 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..
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

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

Post 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?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Technology_Vacation
Posts: 22
Joined: Thu Mar 21, 2013 9:07 am

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

Post by Technology_Vacation »

Nagios XI 2012R1.6

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

Possible bug?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

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

Post 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.
Locked