I recently migrated a nagios core server (Quick Start service) and added it this current XI server. I am in the process of upgrading from xi2012 to xi2014 i ran the upgrade script and when it got to the core 4 part it gave me this:
"make[1]: Leaving directory `/root/nagiosxi/subcomponents/nagioscore/nagios-4.0.5'
Running configuration check... CONFIG ERROR! Restart aborted. Check your Nagios configuration.
So went to the Nagios configuration in xi UI and ran "Write" and got the following:
Write host configurations ...
Host configuration files successfully written!
Write service configurations ...
Service configuration files successfully written!
Configuration file: hostgroups.cfg successfully written!
Configuration file: servicegroups.cfg successfully written!
Configuration file: hosttemplates.cfg successfully written!
Configuration file: servicetemplates.cfg successfully written!
Configuration file: timeperiods.cfg successfully written!
Configuration file: commands.cfg successfully written!
Configuration file: contacts.cfg successfully written!
Configuration file: contactgroups.cfg successfully written!
Configuration file: contacttemplates.cfg successfully written!
Configuration file: servicedependencies.cfg successfully written!
Configuration file: hostdependencies.cfg successfully written!
Configuration file: serviceescalations.cfg successfully written!
Configuration file: hostescalations.cfg successfully written!
Configuration file: serviceextinfo.cfg successfully written!
Configuration file: hostextinfo.cfg successfully written!
Then I ran: "Verify" and got this:
Error: Could not add object property in file '/usr/local/nagios/etc/services/_empty_host.cfg' on line 23.
Nagios Core 4.0.5
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 04-11-2014
License: GPL
Website: http://www.nagios.org
Reading configuration data...
Warning: use_embedded_perl_implicitly is deprecated and will be removed.
Warning: sleep_time is deprecated and will be removed.
Warning: p1_file is deprecated and will be removed.
Warning: external_command_buffer_slots is deprecated and will be removed. All commands are always processed upon arrival
Warning: enable_embedded_perl is deprecated and will be removed.
Warning: command_check_interval is deprecated and will be removed. Commands are always handled on arrival
Read main config file okay...
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in host type objects (config file '/usr/local/nagios/etc/static/check_mk_templates.cfg', starting at line 88)
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in service type objects (config file '/usr/local/nagios/etc/static/check_mk_templates.cfg', starting at line 157)
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in host type objects (config file '/usr/local/nagios/etc/hosttemplates.cfg', starting at line 14)
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in host type objects (config file '/usr/local/nagios/etc/hosttemplates.cfg', starting at line 37)
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in host type objects (config file '/usr/local/nagios/etc/hosttemplates.cfg', starting at line 90)
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in host type objects (config file '/usr/local/nagios/etc/hosttemplates.cfg', starting at line 123)
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in service type objects (config file '/usr/local/nagios/etc/servicetemplates.cfg', starting at line 32)
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in service type objects (config file '/usr/local/nagios/etc/servicetemplates.cfg', starting at line 61)
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in service type objects (config file '/usr/local/nagios/etc/servicetemplates.cfg', starting at line 92)
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in service type objects (config file '/usr/local/nagios/etc/servicetemplates.cfg', starting at line 119)
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in service type objects (config file '/usr/local/nagios/etc/servicetemplates.cfg', starting at line 148)
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in service type objects (config file '/usr/local/nagios/etc/servicetemplates.cfg', starting at line 177)
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in service type objects (config file '/usr/local/nagios/etc/servicetemplates.cfg', starting at line 207)
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in service type objects (config file '/usr/local/nagios/etc/servicetemplates.cfg', starting at line 236)
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in service type objects (config file '/usr/local/nagios/etc/servicetemplates.cfg', starting at line 275)
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in service type objects (config file '/usr/local/nagios/etc/servicetemplates.cfg', starting at line 305)
Warning: Duplicate definition found for service 'pcrmc-service-nocontact' (config file '/usr/local/nagios/etc/services/_empty_host.cfg', starting on line 21)
Error: Could not add object property in file '/usr/local/nagios/etc/services/_empty_host.cfg' on line 23.
Error processing object config files!
***> One or more problems was encountered while processing the config files...
Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.
HERE IS THE _emty_host.cfg file snippet:
12 ###############################################################################
13
14 define service {
15 use generic-service-pcrmc
16 contact_groups admins
17 name pcrmc-service
18 register 1
19 }
20
21 define service {
22 use generic-service-pcrmc-nocontact
23 name pcrmc-service-nocontact
24 register 1
25 }
26
Error: Could not add object property in file
Re: Error: Could not add object property in file
"name" is not a valid directive for a service object.
Do you mean "host_name" or "service_description"?wmendoza wrote:21 define service {
22 use generic-service-pcrmc-nocontact
23 name pcrmc-service-nocontact
24 register 1
25 }
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.
"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.
Re: Error: Could not add object property in file
I agree. This file gets auto populated "from what it states in the header" I tried to edit the file, but it gets overwritten.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Error: Could not add object property in file
Can you open the CCM, select services, select "_empty_host" from the dropdown list.
Make the changes there, then save.
Now before continuing go to CCM -> Tools -> Write Config Tool and click
Write
Verify
Check for further errors, of no errors are found Apply Configuration.
Make the changes there, then save.
Now before continuing go to CCM -> Tools -> Write Config Tool and click
Write
Verify
Check for further errors, of no errors are found Apply Configuration.
Re: Error: Could not add object property in file
We were able to fix the errors and complete the upgrade. But now the monitoring engine wont start. I went to CCM>Write>Verify and did not receive any warnings or errors. I try restarting Nagios from the command line and that fails also.
Re: Error: Could not add object property in file
Does it give any particular error when it fails to start?
Former Nagios employee
Re: Error: Could not add object property in file
The issue has been resolved, I had not updated mklivestatus, I learned that it
absolutely requires recompiling and reinstalling with the core update. I did that, restarted nagios and httpd services and the monitoring engine came back on line. Thank you for all the help on the Forum and over the phone.
absolutely requires recompiling and reinstalling with the core update. I did that, restarted nagios and httpd services and the monitoring engine came back on line. Thank you for all the help on the Forum and over the phone.
Re: Error: Could not add object property in file
Great news! I'll go ahead and lock this thread up now.
Former Nagios employee