Page 1 of 1

5R1.0 Upgrade error

Posted: Thu Oct 01, 2015 10:50 am
by marquetteu
Getting a strange error on upgrade being caused by the install-templates script, hosttemplates.cfg doesn't even have 376 lines. below is the error, attached is the cfg file

Code: Select all

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...
Error: Template 'use' specified in host definition could not be not found (config file '/usr/local/nagios/etc/hosttemplates.cfg', starting on line 376)
   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.

[update 1]
The problem seems to be in the xiwizard templates for both host and service templates -- the use lines are blank and that is making nagios core 4.1.1 angry attachment deleted
[/update 1]

Re: 5R1.0 Upgrade error

Posted: Thu Oct 01, 2015 11:28 am
by lmiltchev
What is the Nagios XI version that you are upgrading from? Can you post the entire "/usr/local/nagiosxi/tmp/upgrade.log"? Do you see any config errors when you run the Write Config Tool?

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

Can you apply configuration successfully?

Re: 5R1.0 Upgrade error

Posted: Thu Oct 01, 2015 1:13 pm
by marquetteu
when i have the config write it will not verify and i am unable to apply the config -- it creates empty "use" lines. To fix it, i had to modify the install-templates line so that it didn't do the reconfigure, then delete all the wizards, manually delete the wizard templates and then manually run the reconfigure

we are upgrading from 4.7

Re: 5R1.0 Upgrade error

Posted: Thu Oct 01, 2015 1:32 pm
by lmiltchev
To fix it, i had to modify the install-templates line so that it didn't do the reconfigure, then delete all the wizards, manually delete the wizard templates and then manually run the reconfigure
Let's clarify - you tried the upgrade but it failed. Then, you deleted all of the wizards & wizard templates, and ran reconfigure_nagios.sh. Is this correct?
Did you delete wizards & templates from the command line or in the CCM?

Check for config errors again - run the Write Config Tool and if there are no errors, Apply Configuration. If there are errors, fix them in the CCM, then Apply Configuration. Only after you clear ALL of the config error, you can rerun the upgrade script. Use the "-f" flag to force upgrading of all of the addons & wizards.

Code: Select all

cd /tmp/nagiosxi
./upgrade -f

Re: 5R1.0 Upgrade error

Posted: Thu Oct 01, 2015 2:24 pm
by marquetteu
no. What i had to do was the following:

edit upgrade commenting out ./install-templates
run the upgrade
login to the partially upgraded system deleting all wizards and xiwizard templates
clear configuration, write configuration files, verify and apply config
manually run install-templates

[update]
I also ran ./upgrade -f and got the same error as before
[/update]

Re: 5R1.0 Upgrade error

Posted: Fri Oct 02, 2015 9:23 am
by lmiltchev
Post the "/usr/local/nagios/etc/hosttemplates.cfg" so that we can take a look at it. Also, run the Write Config Tool and show the output after clicking on each button (in the following order):

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

Re: 5R1.0 Upgrade error

Posted: Fri Oct 02, 2015 9:29 am
by ssax
*** Please follow these steps in order without doing anything in between (don't apply config).

Go to Configure > Core Config Manager > Tools > Write Config Files
- Click Delete (don't worry, it's safe, they get re-written)
- Click Write
- Now zip up your /usr/local/nagios/etc directory and PM that to me so that we can look through it.

Thank you

Re: 5R1.0 Upgrade error

Posted: Fri Oct 02, 2015 9:53 am
by marquetteu
Do you want the file pre or post upgrade?

thanks!
Adam

Re: 5R1.0 Upgrade error

Posted: Fri Oct 02, 2015 10:54 am
by lmiltchev
Do you want the file pre or post upgrade?
We would like to review your configs as of now, so run the Write Config Tool as suggested by ssax. Don't apply configuration. Zip up "/usr/local/nagios/etc/" directory and PM the zip file to ssax (or any of us on the Nagios support team). Thanks!