Upgrade error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Narie
Posts: 57
Joined: Thu Apr 18, 2013 9:36 am

Upgrade error

Post 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?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Upgrade error

Post 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.
Former Nagios employee
Narie
Posts: 57
Joined: Thu Apr 18, 2013 9:36 am

Re: Upgrade error

Post 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
#
###############################################################################
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Upgrade error

Post 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.
Narie
Posts: 57
Joined: Thu Apr 18, 2013 9:36 am

Re: Upgrade error

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Upgrade error

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Narie
Posts: 57
Joined: Thu Apr 18, 2013 9:36 am

Re: Upgrade error

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Upgrade error

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked