Page 1 of 1

How to update to latest Nagios version

Posted: Tue May 16, 2017 12:53 pm
by caterpillartce
Hello,

I noticed there is a new Nagios update from the web interface. and there is a green button to "Upgrade to latest version". Since this will be our first time upgrade, I am hesitate to just click on that button. Is that the way to upgrade Nagios - clicking on that button? Does it backup the existing install automatically in the upgrade process? If not, what kind of manual backup are you recommending before I click on that button? Below shows what we have and what the new version is, in case that makes a difference.

Latest Available Version: 5.4.4
Installed Version: 5.2.9
Last Update Check: 05/16/2017 06:49:01


Thanks!

Re: How to update to latest Nagios version

Posted: Tue May 16, 2017 1:27 pm
by dwhitfield
caterpillartce wrote: Is that the way to upgrade Nagios
Well, it's *a* way. I usually suggest people use https://assets.nagios.com/downloads/nag ... nstall.pdf

As you can see at https://assets.nagios.com/downloads/nag ... Web-UI.pdf, the web version does do a backup first.

Re: How to update to latest Nagios version

Posted: Fri Jun 16, 2017 10:58 am
by caterpillartce
Despite of your wise suggestion for us to upgrade manually, I decided to use the web interface since I am not familiar with Linux and the web interface is not something new so I expect it to work fine... but, it got stuck and there has not been any status message after ~20 minutes. When I looked at the tmp directory I do not see install file downloaded. Instead there is a file named 1785 in /tmp/hsperfdata_nagios with just 32KB in size but the date stamp seems to be changing while size is not growing... Not even sure if that is upgrade related.

And there is not a button to cancel.

I know internet works fine as the "check for updates" worked fine just prior to the upgrade.

What should I do now? I will do it manually if that is the way to go, but how do we cancel the upgrade that was already started from web interface? I do not want the two to collide.

Thanks!

Re: How to update to latest Nagios version

Posted: Fri Jun 16, 2017 11:26 am
by tgriep
When you do an upgrade of XI using the Web interface, it does not use the /tmp folder to download and install the new version of XI, it uses the following folder instead.

Code: Select all

/usr/local/nagiosxi/tmp/
In that folder, there should be and upgrade.log file, can you post that file so we can see any errors on why the system did not finish the upgrade?

Re: How to update to latest Nagios version

Posted: Fri Jun 16, 2017 11:41 am
by caterpillartce
there is no upgrade.log file in that directory.

Re: How to update to latest Nagios version

Posted: Fri Jun 16, 2017 12:33 pm
by tgriep
That is strange that the log file is not there. To stop the web upgrade, run the following command as root on the Nagios server. It is one long command.

Code: Select all

[ $(grep -c mysql /usr/local/nagiosxi/html/config.inc.php) -eq  "2" ] && echo "update xi_commands set status_code = '2' where command = '1120';" | psql nagiosxi nagiosxi || echo "update xi_commands set status_code = '2' where command = '1120';" | mysql -uroot -pnagiosxi nagiosxi
Log out of the XI GUI, log back in and check that the upgrade is not running anymore.

Then, I suggest doing the manual upgrade and see if that works for you.

Re: How to update to latest Nagios version

Posted: Fri Jun 16, 2017 1:37 pm
by caterpillartce
Thank you! That did cancel the upgrade from web.

I then tried to do it manually and ran into a problem right away. We do have a proxy server and I configured it in Nagios, but when doing the upgrade manually, how do I tell it to go through the proxy server? Also, if it makes things easier, can I download the install file in my Windows IE and then put it on the Nagios server /tmp?

[root@nagiosservername myid]# cd /tmp
[root@nagiosservername tmp]# rm -rf nagiosxi xi*.tar.gz
[root@nagiosservername tmp]# wget https://assets.nagios.com/downloads/nag ... est.tar.gz
--2017-06-16 13:21:02-- https://assets.nagios.com/downloads/nag ... est.tar.gz
Resolving assets.nagios.com... 72.14.181.71, 2600:3c00::f03c:91ff:fedf:b821
Connecting to assets.nagios.com|72.14.181.71|:443... failed: Connection timed out.
Connecting to assets.nagios.com|2600:3c00::f03c:91ff:fedf:b821|:443... failed: Network is unreachable.
[root@nagiosservername tmp]#


Thanks!

Re: How to update to latest Nagios version

Posted: Fri Jun 16, 2017 1:42 pm
by caterpillartce
I should have google'd first... got it working to download with -e https_proxy=... in wget

now moving on to install... hope all works!

Re: How to update to latest Nagios version

Posted: Fri Jun 16, 2017 1:50 pm
by cdienger
Keep us posted : )

Re: How to update to latest Nagios version

Posted: Fri Jun 16, 2017 1:54 pm
by caterpillartce
yes it finished successfully!

Thanks for the help!