Page 1 of 1

Upgrade issues

Posted: Thu Oct 06, 2016 2:01 am
by developerx9
Hello,

I'm having issues updating our nagios to the latest version.
Version being used is 5.2.9 and here is the output:

---- Starting Nagios XI Upgrade ----
Cleaning up temp directory...
No entry for terminal type "unknown";
using dumb terminal settings.
No entry for terminal type "unknown";
using dumb terminal settings.


Log says:

Things look okay - No serious problems were detected during the pre-flight check
RET: 0
Fixing php-mcrypt bug...
No entry for terminal type "unknown";
using dumb terminal settings.
==================
UPGRADE COMPLETED!
==================

This is what TERM variable is set to:
# echo $TERM
xterm-256color

so I changed that by executing the script manually:

[06:47:35] root@nagios:/usr/local/nagiosxi/scripts
# TERM=dumb bash upgrade_to_latest.sh

TL,DR: it failed again:
http://pastebin.com/tqDvn6qy

It appears there's an issue with column key.
ERROR 1060 (42S21) at line 5: Duplicate column name 'api_key'


P.S - we have an enterprise license so I'm not sure if this is something you can correct for us?

Thank you.

Re: Upgrade issues

Posted: Thu Oct 06, 2016 10:14 am
by jomann
It looks like because you failed out of the upgrade for whatever reason, you'll need to run it manually from the cmdline and edit the main config file.

Download the latest tarball -

Code: Select all

cd /tmp
rm -rf xi-*.tar.gz nagiosxi
wget https://assets.nagios.com/downloads/nagiosxi/5/xi-5.3.0.tar.gz
tar xf xi-5.3.0.tar.gz
cd nagiosxi
Once you're inside that directory, remove lines 820-828 from the upgrade file in order to run the upgrade script once more - your MySQL has already been updated which is causing it to error out before finishing the upgrade. This should let us see what the real problem is with the upgrade.

Re: Upgrade issues

Posted: Tue Oct 11, 2016 2:21 am
by developerx9
Hello,

After removing said line, installation fails on:
"Attempting to read global hard/soft nofile limits failed. Check /etc/security/limits.conf and try again!"

The issue is with the ./subcomponents/mrtg/increase_open_file_limits.sh script which incorrectly parses limits on CentOS 7 based installations. (Or at least in our case)

Here's the problem:

Code: Select all

	# check if global hard/soft limits are defined
	if grep -q "^\*\s*hard" $limitfile && grep -q "^\*\s*soft" $limitfile; then

		# if they are, we need to get their current values and increase them!
		global_hard=$(grep "^\*\s*hard" $limitfile | awk '{ print $4 }')
		global_soft=$(grep "^\*\s*soft" $limitfile | awk '{ print $4 }')

		# make sure we got sane [numeric] values
		if ! [[ $global_hard =~ $numcheck && $global_soft =~ $numcheck ]]; then
			echo "Attempting to read global hard/soft nofile limits failed. Check $limitfile and try again!" >&2
			exit 1
		fi
Since our limits is configured as:

Code: Select all

root               soft    nofile           100000
root               hard    nofile           100000
*                  soft    sigpending        14791
*                  hard    sigpending        14791
*		   soft    stack             10240
*		   hard    stack             10240
*		   soft    nproc             14791
*                  hard    nproc 	     14791
The above code won't work as it'll return multiple values and not match an integer.

Changing the global_hard and global_soft variable resolved the issue:

Code: Select all

global_hard=$(grep -E 'root|nofile' $limitfile | grep hard| grep -ve "\*" -ve "#" | awk '{print $4}')
global_soft=$(grep -E 'root|nofile' $limitfile | grep soft| grep -ve "\*" -ve "#" | awk '{print $4}')
Upgrade has finished and is working correctly now. I don't believe I'll be the only one with said problem so you might want to see if there's a more "stable" check for this.
Example:

Code: Select all

global_hard=$(ulimit -Hn) 
should be just fine.

Thank you.

Re: Upgrade issues

Posted: Tue Oct 11, 2016 10:31 am
by avandemore
developerx9,

The issue has been fixed from our end. Thanks for taking the time to delve into this. Are we good to close this thread now?

Re: Upgrade issues

Posted: Tue Oct 11, 2016 11:46 am
by developerx9
Hey avandemore,

We're good. Thank you :)