Page 1 of 1

Upgrade to 5.6.4 said it failed but it didn't

Posted: Wed Jul 10, 2019 8:55 am
by jbpatric
Started the upgrade to 5.6.4 from the Admin-Check For Updates screen. When it finished it returned a message that the update failed and I should update Nagios manually. But, upon refreshing the Check For Updates page it shows I'm running version 5.6.4 now and the version in the bottom left corner of the webpage shows 5.6.4. Luckily I copied the upgrade text before refreshing the pages because the Update History at the bottom of the Check For Updates page doesn't have an entry for today's upgrade.

Here's the upgrade output...
---- Starting Nagios XI Backup ----
No entry for terminal type "unknown";
using dumb terminal settings.
Backing up Nagios Core...
tar: Removing leading `/' from member names
tar: /usr/local/nagios/var/rw/nagios.qh: socket ignored
tar: /usr/local/nagios/var/ndo.sock: socket ignored
Backing up Nagios XI...
tar: Removing leading `/' from member names
tar: /usr/local/nagiosxi/var/sysstat.log: file changed as we read it
tar: /usr/local/nagiosxi/var/eventman.log: file changed as we read it
tar: /usr/local/nagiosxi/var/cmdsubsys.log: file changed as we read it
tar: /usr/local/nagiosxi/var: file changed as we read it
Backing up MRTG...
tar: Removing leading `/' from member names
Backing up the SNMP directories
tar: Removing leading `/' from member names
tar: Removing leading `/' from member names
Backing up NRDP...
tar: Removing leading `/' from member names
Backing up Nagvis...
tar: Removing leading `/' from member names
Backing up nagios user home dir...
tar: Removing leading `/' from member names
Backing up MySQL databases...
Backing up cronjobs for Apache...
Backing up logrotate config files...
Backing up Apache config files...
Compressing backup...

===============
BACKUP COMPLETE
===============
Backup stored in /store/backups/nagiosxi/autoupgrade_backup.1562762048.tar.gz

---- Starting Nagios XI Upgrade ----
Cleaning up temp directory...
No entry for terminal type "unknown";
using dumb terminal settings.
Nagios XI Upgrade Log
==========================
DATE: Wed Jul 10 08:37:45 EDT 2019

DISTRO INFO:
CentOS
7.6.1810
x86_64


No entry for terminal type "unknown";
using dumb terminal settings.
Archive: sourceguardian/ixed4.lin.x86-64.zip
inflating: /usr/lib64/php/modules/ixed.5.4.lin
Sourceguardian extension found for PHP version 5.4
Sourceguardian extension already in php.ini
No entry for terminal type "unknown";
using dumb terminal settings.
Checking required prereqs...
Please wait...

OLD VERSION: 5603
Loaded plugins: fastestmirror
Determining fastest mirrors
* base: ftp.ussg.iu.edu
* epel: mirror.steadfastnet.com
* extras: ftp.ussg.iu.edu
* updates: ftp.ussg.iu.edu
No packages marked for update
Loaded plugins: fastestmirror
Examining /usr/local/nagiosxi/tmp/nagiosxi/nagiosxi-deps-el7-5.6.4-1.noarch.rpm: nagiosxi-deps-el7-5.6.4-1.noarch
Marking /usr/local/nagiosxi/tmp/nagiosxi/nagiosxi-deps-el7-5.6.4-1.noarch.rpm as an update to nagiosxi-deps-el7-5.6.3-1.noarch
Resolving Dependencies
--> Running transaction check
---> Package nagiosxi-deps-el7.noarch 0:5.6.3-1 will be updated
---> Package nagiosxi-deps-el7.noarch 0:5.6.4-1 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Updating:
nagiosxi-deps-el7 noarch 5.6.4-1 /nagiosxi-deps-el7-5.6.4-1.noarch 0.0

Transaction Summary
================================================================================
Upgrade 1 Package

Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating : nagiosxi-deps-el7-5.6.4-1.noarch 1/2
Cleanup : nagiosxi-deps-el7-5.6.3-1.noarch 2/2
Verifying : nagiosxi-deps-el7-5.6.4-1.noarch 1/2
Verifying : nagiosxi-deps-el7-5.6.3-1.noarch 2/2

Updated:
nagiosxi-deps-el7.noarch 0:5.6.4-1

Complete!
UPGRADE: NRDP is being upgraded...
UPGRADE: NRDP upgraded OK.
no crontab for nagios
no crontab for root
Copying over new XI directory...
No entry for terminal type "unknown";
using dumb terminal settings.
Patching NDOUtils...
NDOUtils already patched at level 103
Installing new PNP templates...
Enabling large install tweaks...
Fixing config file permissions...
chown: cannot access ‘/var/www/html/nagiosql/config’: No such file or directory
Fixing htpasswd permissions...
Checking group memberships...
Installing new XI templates...
No entry for terminal type "unknown";
using dumb terminal settings.

--- reset_config_perms.sh ------------
> Setting script permissions
> Setting CCM script permissions
> Setting special script permissions
> Setting special component script permissions
> Setting configuration file/directory permissions
> Setting perfdata directory and RRD permissions
> Setting libexec directory permissions
> Setting Nagios XI config permissions
> Setting NOM checkpoint user:group permissions
> + Setting Nagios Core corelog.newobjects user:group permissions
> + Setting CCM configuration file user:group permissions
> + Setting Recurring Downtime file user:group permissions
> + Setting BPI configuration file user:group permissions
--------------------------------------
No entry for terminal type "unknown";
using dumb terminal settings.

--- ccm_import.php -------------------
> Setting import directory: /usr/local/nagios/etc/import/
> Importing config files into the CCM
- Importing: /usr/local/nagios/etc/import/xi_timeperiod_24x7.cfg .. SUCCESS
--------------------------------------
No entry for terminal type "unknown";
using dumb terminal settings.

--- ccm_export.php -------------------
> Writing CCM configuration to Nagios files
Finished writing out configuraton
--------------------------------------

--------------------------------------
> Verifying configuration with Nagios Core
> Output:
Nagios Core 4.4.3
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2019-01-15
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Warning: Duplicate definition found for timeperiod 'xi_timeperiod_24x7' (config file '/usr/local/nagios/etc/timeperiods.cfg', starting on line 472)
Error: Could not add object property in file '/usr/local/nagios/etc/timeperiods.cfg' on line 476.
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 definitions. 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.
> Return Code: 1
--------------------------------------
No entry for terminal type "unknown";
using dumb terminal settings.
/usr/local/nagiosxi/nom/checkpoints/nagioscore/errors /usr/local/nagiosxi/scripts
tar: Removing leading `/' from member names
/usr/local/nagiosxi/scripts
LATEST NOM SNAPSHOT: /usr/local/nagiosxi/nom/checkpoints/nagioscore/1562759879.tar.gz
/ /usr/local/nagiosxi/scripts
RESTORING NOM SNAPSHOT : /usr/local/nagiosxi/nom/checkpoints/nagioscore/1562759879.tar.gz
/usr/local/nagiosxi/scripts
No entry for terminal type "unknown";
using dumb terminal settings.

--- reset_config_perms.sh ------------
> Setting script permissions
> Setting CCM script permissions
> Setting special script permissions
> Setting special component script permissions
> Setting configuration file/directory permissions
> Setting perfdata directory and RRD permissions
> Setting libexec directory permissions
> Setting Nagios XI config permissions
> Setting NOM checkpoint user:group permissions
> + Setting Nagios Core corelog.newobjects user:group permissions
> + Setting CCM configuration file user:group permissions
> + Setting Recurring Downtime file user:group permissions
> + Setting BPI configuration file user:group permissions
--------------------------------------
The only error I see is...
Warning: Duplicate definition found for timeperiod 'xi_timeperiod_24x7' (config file '/usr/local/nagios/etc/timeperiods.cfg', starting on line 472)
Error: Could not add object property in file '/usr/local/nagios/etc/timeperiods.cfg' on line 476.
Error processing object config files!
Here are the lines referenced in the error from the timeperiods.cfg file...
472 define timeperiod {
473 timeperiod_name xi_timeperiod_24x7
474 alias 24x7 Excluding Weekly Maint Window
475 exclude weekly-maintenance
476 sunday 00:00-24:00
477 monday 00:00-24:00
478 tuesday 00:00-24:00
479 wednesday 00:00-24:00
480 thursday 00:00-24:00
481 friday 00:00-24:00
482 saturday 00:00-24:00
483 }
I don't see a duplicate.
Plus, when I run Verify Files from under the Config-Core Config Manager-Config File Management page there are no errors.

So, to conclude, this is really a two part request for help.
Did the server really upgrade? Or, do I need to do a manual upgrade?
Why am I receiving an error related to timeperiods.cfg?

Re: Upgrade to 5.6.4 said it failed but it didn't

Posted: Wed Jul 10, 2019 1:10 pm
by benjaminsmith
Hello @jbpatric,

It looks like it upgraded fine but you have an error your current configuration files. Go to Configure > CCM > Tools > Config File Management, and perform the following operations.

1. Delete Files
2. Write Configs
3. Verify Files (if there are any errors correct then in the Core Configuration Manager and then repeat the first 2 steps and until there are no errors).
4. Restart Nagios Core

Let me know if your able to correct this or if you have any questions.

Re: Upgrade to 5.6.4 said it failed but it didn't

Posted: Wed Jul 10, 2019 6:36 pm
by jbpatric
Following your steps we are error free now.

In the time period, xi_timeperiod_24x7, the template line also referenced the same name. Took that out and the config files regenerated.

Re: Upgrade to 5.6.4 said it failed but it didn't

Posted: Thu Jul 11, 2019 8:04 am
by scottwilkerson
jbpatric wrote:Following your steps we are error free now.

In the time period, xi_timeperiod_24x7, the template line also referenced the same name. Took that out and the config files regenerated.
Great!

Locking thread