Page 1 of 1

Duplicate entry errors after removing static files

Posted: Thu Feb 04, 2016 2:53 pm
by ray-fc
I've migrated from some static files that I was using during initial setup to hosts entered through autodiscovery. I've deleted the static files, but now all hosts that were in a static file is now 'inactive'. When I try to set one to 'active' I get a message like the one below:


Error: Could not add object property in file '/usr/local/nagios/etc/hosts/ads201.dc.farecompare.com.cfg' on line 17.

Nagios Core 4.1.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-19-2015
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Warning: Duplicate definition found for host 'ads201.dc.farecompare.com' (config file '/usr/local/nagios/etc/hosts/ads201.dc.farecompare.com.cfg', starting on line 16)
Error: Could not add object property in file '/usr/local/nagios/etc/hosts/ads201.dc.farecompare.com.cfg' on line 17.
Error processing object config files!

Re: Duplicate entry errors after removing static files

Posted: Thu Feb 04, 2016 10:28 pm
by Box293
Can you follow these steps please:

Go into CCM
Tools > Write Config Files
Click the Delete button
It will say "Successfully deleted all Host / Service Config Files"
Click the Write Button
It will show an output of all the files it creates
Click the Verify button

Do you get errors?

If you do, can you post the file /usr/local/nagios/etc/hosts/ads201.dc.farecompare.com.cfg
It doesn't exist in the profile you sent, because there was an error during Apply nagios reverts back to the previous configs, hence the steps above are required.