Warning: Duplicate definition found for service 'Total Proce

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
hack3rcon
Posts: 27
Joined: Sat Jul 16, 2016 9:50 am

Warning: Duplicate definition found for service 'Total Proce

Post by hack3rcon »

Hello.
When I use "/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg" then it show me :

Code: Select all

Nagios Core 4.0.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 10-15-2013
License: GPL

Website: http://www.nagios.org
Reading configuration data...
   Read main config file okay...
Warning: Duplicate definition found for service 'Total Processes' on host 'localhost' (config file '/usr/local/nagios/etc/objects/localhost.cfg', starting on line 101)
Warning: Duplicate definition found for service 'Current Users' on host 'localhost' (config file '/usr/local/nagios/etc/objects/localhost.cfg', starting on line 89)
   Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
	Checked 11 services.
	Checked 2 hosts.
	Checked 1 host groups.
	Checked 0 service groups.
	Checked 1 contacts.
	Checked 1 contact groups.
	Checked 25 commands.
	Checked 5 time periods.
	Checked 0 host escalations.
	Checked 0 service escalations.
Checking for circular paths...
	Checked 2 hosts
	Checked 0 service dependencies
	Checked 0 host dependencies
	Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Warning: Duplicate definition found for service 'Total P

Post by rkennedy »

Then it appears there are multiple definitions found for the same service. Take a look at your configuration files and see where they are occurring. You should be able to run grep -r -A 5 -B 5 'Total Processes' /usr/local/nagios/etc/ to help search through them all.
Former Nagios Employee
hack3rcon
Posts: 27
Joined: Sat Jul 16, 2016 9:50 am

Re: Warning: Duplicate definition found for service 'Total P

Post by hack3rcon »

The result is :

Code: Select all

[root@localhost ~]# grep -r -A 5 -B 5 'Total Processes' /usr/local/nagios/etc/
/usr/local/nagios/etc/objects/localhost.cfg-# > 400 users.
/usr/local/nagios/etc/objects/localhost.cfg-
/usr/local/nagios/etc/objects/localhost.cfg-define service{
/usr/local/nagios/etc/objects/localhost.cfg-        use                             local-service         ; Name of service template to use
/usr/local/nagios/etc/objects/localhost.cfg-        host_name                       localhost
/usr/local/nagios/etc/objects/localhost.cfg:        service_description             Total Processes
/usr/local/nagios/etc/objects/localhost.cfg-	check_command			check_local_procs!250!400!RSZDT
/usr/local/nagios/etc/objects/localhost.cfg-        }
/usr/local/nagios/etc/objects/localhost.cfg-
/usr/local/nagios/etc/objects/localhost.cfg-
/usr/local/nagios/etc/objects/localhost.cfg-
--
/usr/local/nagios/etc/services.cfg-check_command           check_nrpe!check_load
/usr/local/nagios/etc/services.cfg-}
/usr/local/nagios/etc/services.cfg-define service{
/usr/local/nagios/etc/services.cfg-use                     generic-service
/usr/local/nagios/etc/services.cfg-host_name               localhost
/usr/local/nagios/etc/services.cfg:service_description     Total Processes
/usr/local/nagios/etc/services.cfg-check_command           check_nrpe!check_total_procs
/usr/local/nagios/etc/services.cfg-}
/usr/local/nagios/etc/services.cfg-define service{
/usr/local/nagios/etc/services.cfg-use                     generic-service
/usr/local/nagios/etc/services.cfg-host_name               localhost
How can I solve it?
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Warning: Duplicate definition found for service 'Total P

Post by Box293 »

You have the a service definition in these files that have the same service_description:

/usr/local/nagios/etc/objects/localhost.cfg
/usr/local/nagios/etc/services.cfg

You need to remove / comment out the duplicate services in one of these files. I would do this to the file:
/usr/local/nagios/etc/services.cfg
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
hack3rcon
Posts: 27
Joined: Sat Jul 16, 2016 9:50 am

Re: Warning: Duplicate definition found for service 'Total P

Post by hack3rcon »

Thank you.
I did it and problem solved. I hope it cause not any problem.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Warning: Duplicate definition found for service 'Total P

Post by mcapra »

Is it alright if we lock this thread and mark the issue as resolved?
Former Nagios employee
https://www.mcapra.com/
hack3rcon
Posts: 27
Joined: Sat Jul 16, 2016 9:50 am

Re: Warning: Duplicate definition found for service 'Total P

Post by hack3rcon »

Yes. I remove the lines and problem solved.
Locked