Page 1 of 1

Warning: Duplicate definition found for service 'Total Proce

Posted: Tue Jul 26, 2016 5:15 am
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

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

Posted: Tue Jul 26, 2016 9:47 am
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.

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

Posted: Wed Jul 27, 2016 12:27 am
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?

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

Posted: Wed Jul 27, 2016 1:29 am
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

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

Posted: Wed Jul 27, 2016 1:57 am
by hack3rcon
Thank you.
I did it and problem solved. I hope it cause not any problem.

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

Posted: Wed Jul 27, 2016 9:52 am
by mcapra
Is it alright if we lock this thread and mark the issue as resolved?

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

Posted: Sun Jul 31, 2016 7:45 am
by hack3rcon
Yes. I remove the lines and problem solved.