Hello:
The Configuration snapshot identifies the following warning message for about 6 Hosts:
"
Warning: Duplicate definition found for service 'HTTP' on host '<EDITED: SERVER 1>' (config file '/usr/local/nagios/etc/services/<EDITED: SERVER 1>.cfg', starting on line 31)
Warning: Duplicate definition found for service 'HTTP' on host '<EDITED: SERVER 1>' (config file '/usr/local/nagios/etc/services/<EDITED: SERVER 1>.cfg', starting on line 14)
"
All 6 Hosts have the same HTTP line repeated, but not the same number of times repeated (one has only 1 additional repeated HTTP entry, another may have 3 additional repeated entries):
"define service {
host_name <EDITED: SERVER x>
service_description HTTP
use xiwizard_tcp_service
check_command check_xi_service_tcp!-p 80
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
first_notification_delay 15
notification_period xi_timeperiod_24x7
contacts <EDITED: CONTACT NAME>
_xiwizard autodiscovery
register 1
}
"
One specific server is a Linux RedHat server with Apache and another is a Windows 2008 R2 Enterprise server using IIS 7, so this problem does not appear to have a common denominator that I can see.
Additionally, the respected .CFG files state "--- DO NOT EDIT THIS FILE BY HAND ---"
I looked at the Hosts and see only HTTP reference/service.
Any ideas on if this can be fixed, or identify if this is okay and what does it mean (is there more than one HTTP service running on the server, but I am not identifying that), or ??
Thank you.
Warning: Duplicate definition found for service 'HTTP' on ..
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Warning: Duplicate definition found for service 'HTTP' o
Is this service only being displayed once in the web interface? Does anything differ about how they are set up in the flat config file? Any arguments different, contacts, etc? If they do, find out which one matches what is being displayed in the XI web interface, then remove the other definition. The reason they say do not edit by hand is because they will be overwritten by nagios, however, if nagios is only picking up and displaying one of those duplicate services, I believe you will be able to remove the old, false, non read one and it should keep that change when you apply configuration.
Re: Warning: Duplicate definition found for service 'HTTP' o
I checked Services and noted that there were duplicated HTTP services for the respective Hosts, so I deleted the duplicated HTTP Services for each respective Host and clicked "Apply Configuration" after each deletion. Each respected Hosts' Services' Text Config looks fine.
I went to Tools - Write Config Files and clicked "Write" and then clicked "Verify" and received the (edited) message that is noted further below the asterisks.
However, even though the duplicate HTTP Services do not display in the web GUI console, the corresponding
/usr/local/nagios/etc/services/<x>.cfg
files on the server still contain the duplicated references.
************************************************************************
Nagios Core 4.0.6
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 04-29-2014
License: GPL
Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Warning: Duplicate definition found for service 'HTTP' on host '<EDITED: SERVER1>' (config file '/usr/local/nagios/etc/services/<EDITED: SERVER1>.cfg', starting on line 31)
Warning: Duplicate definition found for service 'HTTP' on host '<EDITED: SERVER1>' (config file '/usr/local/nagios/etc/services/<EDITED: SERVER1>.cfg', starting on line 14)
Warning: Duplicate definition found for service 'HTTP' on host '<EDITED: SERVER2>' (config file '/usr/local/nagios/etc/services/<EDITED: SERVER2>.cfg', starting on line 14)
Warning: Duplicate definition found for service 'HTTP' on host '<EDITED: SERVER3>' (config file '/usr/local/nagios/etc/services/<EDITED: SERVER3>.cfg', starting on line 31)
Warning: Duplicate definition found for service 'HTTP' on host '<EDITED: SERVER3>' (config file '/usr/local/nagios/etc/services/<EDITED: SERVER3>', starting on line 14)
Warning: Duplicate definition found for service 'HTTP' on host '<EDITED: SERVER4>' (config file '/usr/local/nagios/etc/services/<EDITED: SERVER4>', starting on line 46)
Warning: Duplicate definition found for service 'HTTP' on host '<EDITED: SERVER4>' (config file '/usr/local/nagios/etc/services/<EDITED: SERVER4>', starting on line 30)
Warning: Duplicate definition found for service 'HTTP' on host '<EDITED: SERVER4>' (config file '/usr/local/nagios/etc/services/<EDITED: SERVER4>', starting on line 14)
Warning: Duplicate definition found for service 'HTTP' on host '<EDITED: SERVER5>' (config file '/usr/local/nagios/etc/services/<EDITED: SERVER5>.cfg', starting on line 14)
Warning: Duplicate definition found for service 'HTTP' on host '<EDITED: SERVER6>' (config file '/usr/local/nagios/etc/services/<EDITED: SERVER6>.cfg', starting on line 14)
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 834 services.
Checked 216 hosts.
Checked 6 host groups.
Checked 0 service groups.
Checked 2 contacts.
Checked 2 contact groups.
Checked 116 commands.
Checked 8 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 216 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 8 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
I went to Tools - Write Config Files and clicked "Write" and then clicked "Verify" and received the (edited) message that is noted further below the asterisks.
However, even though the duplicate HTTP Services do not display in the web GUI console, the corresponding
/usr/local/nagios/etc/services/<x>.cfg
files on the server still contain the duplicated references.
************************************************************************
Nagios Core 4.0.6
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 04-29-2014
License: GPL
Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Warning: Duplicate definition found for service 'HTTP' on host '<EDITED: SERVER1>' (config file '/usr/local/nagios/etc/services/<EDITED: SERVER1>.cfg', starting on line 31)
Warning: Duplicate definition found for service 'HTTP' on host '<EDITED: SERVER1>' (config file '/usr/local/nagios/etc/services/<EDITED: SERVER1>.cfg', starting on line 14)
Warning: Duplicate definition found for service 'HTTP' on host '<EDITED: SERVER2>' (config file '/usr/local/nagios/etc/services/<EDITED: SERVER2>.cfg', starting on line 14)
Warning: Duplicate definition found for service 'HTTP' on host '<EDITED: SERVER3>' (config file '/usr/local/nagios/etc/services/<EDITED: SERVER3>.cfg', starting on line 31)
Warning: Duplicate definition found for service 'HTTP' on host '<EDITED: SERVER3>' (config file '/usr/local/nagios/etc/services/<EDITED: SERVER3>', starting on line 14)
Warning: Duplicate definition found for service 'HTTP' on host '<EDITED: SERVER4>' (config file '/usr/local/nagios/etc/services/<EDITED: SERVER4>', starting on line 46)
Warning: Duplicate definition found for service 'HTTP' on host '<EDITED: SERVER4>' (config file '/usr/local/nagios/etc/services/<EDITED: SERVER4>', starting on line 30)
Warning: Duplicate definition found for service 'HTTP' on host '<EDITED: SERVER4>' (config file '/usr/local/nagios/etc/services/<EDITED: SERVER4>', starting on line 14)
Warning: Duplicate definition found for service 'HTTP' on host '<EDITED: SERVER5>' (config file '/usr/local/nagios/etc/services/<EDITED: SERVER5>.cfg', starting on line 14)
Warning: Duplicate definition found for service 'HTTP' on host '<EDITED: SERVER6>' (config file '/usr/local/nagios/etc/services/<EDITED: SERVER6>.cfg', starting on line 14)
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 834 services.
Checked 216 hosts.
Checked 6 host groups.
Checked 0 service groups.
Checked 2 contacts.
Checked 2 contact groups.
Checked 116 commands.
Checked 8 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 216 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 8 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
Newbie '14
Re: Warning: Duplicate definition found for service 'HTTP' o
Perhaps you have an orphan config file. (services removed from the database, but the config file remained in the directory).
You could try deleting or moving the config file(s) out of the directory and hitting 'Apply Configuration' again to see if XI will
re-create the file with the correct services or if it's not needed it will not be created at all. There is more than one way to
create a service named HTTP. You could use the tcp check to do a simple check of port 80 (like in your example config),
or you could use the the web* (website?) wizard to do an actual HTTP protocol check of port 80. Also I think if you use the
wizard to do an HTTPS check it names the service HTTP so to do both I would setup the port 443 check first then rename
the service to HTTPS then run the wizard again and do port 80. Then I found for new hosts it was much easier to just go
into the CCM and copy an existing check and rename the config file change the target host so I don't use the wizards
anymore.
You could try deleting or moving the config file(s) out of the directory and hitting 'Apply Configuration' again to see if XI will
re-create the file with the correct services or if it's not needed it will not be created at all. There is more than one way to
create a service named HTTP. You could use the tcp check to do a simple check of port 80 (like in your example config),
or you could use the the web* (website?) wizard to do an actual HTTP protocol check of port 80. Also I think if you use the
wizard to do an HTTPS check it names the service HTTP so to do both I would setup the port 443 check first then rename
the service to HTTPS then run the wizard again and do port 80. Then I found for new hosts it was much easier to just go
into the CCM and copy an existing check and rename the config file change the target host so I don't use the wizards
anymore.
Re: Warning: Duplicate definition found for service 'HTTP' o
@PhilG
Did jwelch's post help? Were you able to resolve your issue?
Did jwelch's post help? Were you able to resolve your issue?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Warning: Duplicate definition found for service 'HTTP' o
I have not attempted the possible solution yet since I've been interviewing potential candidates for a job search for the past several hours. I can try in a few minutes since I have a free moment.lmiltchev wrote:@PhilG
Did jwelch's post help? Were you able to resolve your issue?
Newbie '14
Re: Warning: Duplicate definition found for service 'HTTP' o
I have moved the 6 respective "problematic" Hosts' .CFG files to another directory on the server, went into the Nagios XI web console, verified the Hosts and respective Services of the 6 respective "problematic" Hosts, then applied configuration and write configuration, did a restart, and then verified the .CFG files on the server.
The .CFG files appear to be fine now and there are no warning messages in the Config file.
Thank you for your assistance.
Getting closer to putting this into production.
This can be closed.
The .CFG files appear to be fine now and there are no warning messages in the Config file.
Thank you for your assistance.
Getting closer to putting this into production.
This can be closed.
Newbie '14