Page 1 of 1

Upgrade error

Posted: Mon Jul 07, 2014 8:02 am
by Narie
During upgrading from 2012 to the latest version, the upgrade proces stopped with the message:

Code: Select all

make[1]: Leaving directory `/tmp/nagiosxi/subcomponents/nagioscore/nagios-4.0.7'
Running configuration check... CONFIG ERROR!  Restart aborted.  Check your Nagios configuration.
I have read the FAQs about the know issues about how to approach this, but I don't get any further.
When I Write Database Configs To File I the following error:

Code: Select all

Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/Internet-diensten.cfg', starting on line 14) 

Nagios Core 4.0.7 
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors 
Copyright (c) 1999-2009 Ethan Galstad 
Last Modified: 06-03-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/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 136) 
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 14) 
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 137) 
Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/Internet-diensten.cfg', starting on line 14) 
Error processing object config files! 
Can you please help me to solve this?

Re: Upgrade error

Posted: Mon Jul 07, 2014 9:49 am
by tmcdonald

Code: Select all

Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/Internet-diensten.cfg', starting on line 14) 
Can you please post /usr/local/nagios/etc/services/Internet-diensten.cfg or at least show us line 14? It looks like you just need to provide a service description.

Re: Upgrade error

Posted: Mon Jul 07, 2014 10:05 am
by Narie
tmcdonald wrote:

Code: Select all

Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/Internet-diensten.cfg', starting on line 14) 
Can you please post /usr/local/nagios/etc/services/Internet-diensten.cfg or at least show us line 14? It looks like you just need to provide a service description.

Code: Select all

###############################################################################
#
# Service configuration file
#
# Created by: Nagios QL Version 3.0.3
# Date:       2014-07-07 14:16:23
# Version:    Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios QL will overwite all manual settings during the next update
#
###############################################################################

define service {
        service_description             ServiceNetwerk
        notifications_enabled           1
        register                        1
        }

###############################################################################
#
# Service configuration file
#
# END OF FILE
#
###############################################################################

Re: Upgrade error

Posted: Mon Jul 07, 2014 10:14 am
by slansing
Looks like that service has not been assigned to a host, it was likely a ghost service who's host was removed previously but it stayed around as a flat config file. You can remove this service and re run the upgrade:

Code: Select all

rm -f /usr/local/nagios/etc/services/Internet-diensten.cfg
You could also try to apply configuration after removing it, if it does not get repopulated in '/usr/local/nagios/etc/services/' then it was a ghost.

Re: Upgrade error

Posted: Tue Jul 08, 2014 3:28 am
by Narie
Thanks for your support.
I have remove the specific file, and applied the config. Unfortunately it ends with an error:

Code: Select all

An error occurred while attempting to apply your configuration to Nagios Core. Monitoring engine configuration files have been rolled back to their last known good checkpoint.
slansing wrote:Looks like that service has not been assigned to a host, it was likely a ghost service who's host was removed previously but it stayed around as a flat config file. You can remove this service and re run the upgrade:

Code: Select all

rm -f /usr/local/nagios/etc/services/Internet-diensten.cfg
You could also try to apply configuration after removing it, if it does not get repopulated in '/usr/local/nagios/etc/services/' then it was a ghost.

Re: Upgrade error

Posted: Tue Jul 08, 2014 9:03 am
by lmiltchev
Nagios cannot start or restart with a bad configuration. You need to use the Write Config Tool to check for config errors:

CCM->Tools->Write Config Files->Write->Verify

If you find config errors, you need to fix them, then run the Write Config Tool AGAIN, as you may have more errors. Run the Write Config Tool as many times as you need to. Once, ALL of the config errors have been fixed, you can apply configuration.

Do you have any config errors now when you run the Write Config Tool?

Re: Upgrade error

Posted: Thu Jul 10, 2014 2:04 am
by Narie
Because of limited time had to cancel the upgrade, and rolled back the snapshot of the server. I will start a copy of this server soon to follow your advice. Thanks for your support.

Re: Upgrade error

Posted: Thu Jul 10, 2014 11:50 am
by lmiltchev
Sounds good. I will be locking this post. If you run into some issues, while performing the upgrade, please, start a new thread.