Page 1 of 1

Unable to Update Nagios Core 3.5.1

Posted: Tue Oct 23, 2018 1:30 pm
by BrunoLosse1
Hello all,

I have Nagios Core v3.5.1 installed in my Ubuntu 16.4 and I'm trying to update to the latest version (4.4.2).
I've tried to follow the step-by-step provided at the link: https://assets.nagios.com/downloads/nag ... ading.html
but after logging as the Nagios user it says I don't have permission to execute the download.

I've tried to update using the root user, and when I verify the config files using /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg it says I have the version 4.4.2 but when I acces http://localhost/nagios/ it does not load. It only loads when I visit http://localhost/nagios3

Re: Unable to Update Nagios Core 3.5.1

Posted: Tue Oct 23, 2018 4:17 pm
by tgriep
In the link, there is a section for editing the Apache config files.
Important: If you are upgrading from version 4.2.4 or before, to version 4.3.0 or after, there are changes that need to be made to the 'nagios.conf' apache configuration file. You can either update it manually, copying the new parts from 'sample-config/httpd.conf' or run

cd /etc/httpd/conf.d
cp nagios.conf nagios.conf.bak
cd /<the nagios build directory>
make install-webconf
service httpd restart
Verify that the changes were done and is they were, upload the Apache nagios.conf file so we can view it.
Also, check the Apache Error logs when you try and access the URL.
The logs are in this folder.

Code: Select all

/var/log/apache2

Re: Unable to Update Nagios Core 3.5.1

Posted: Thu Oct 25, 2018 9:31 am
by BrunoLosse1
I saw the section, but there is no httpd directory. What I have at /etc/ is https://gefco-my.sharepoint.com/:i:/g/p ... Q?e=vty9AN

Logs:

error.log:

[Thu Oct 25 06:25:02.117313 2018] [mpm_prefork:notice] [pid 37985] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Thu Oct 25 06:25:02.117332 2018] [core:notice] [pid 37985] AH00094: Command line: '/usr/sbin/apache2'

error.log.1:

[Wed Oct 24 06:25:01.358428 2018] [mpm_prefork:notice] [pid 37985] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Wed Oct 24 06:25:01.358457 2018] [core:notice] [pid 37985] AH00094: Command line: '/usr/sbin/apache2'
[Thu Oct 25 06:25:02.086615 2018] [mpm_prefork:notice] [pid 37985] AH00171: Graceful restart requested, doing restart

Re: Unable to Update Nagios Core 3.5.1

Posted: Thu Oct 25, 2018 10:38 am
by tgriep
OK, those instructions are for upgrading a Centos system and you are running Ubuntu and the Apache config files are in the /etc/apache2 folder.
So I would guess that the Apache config file did not set updated and is causing the issue.

There is another article that has steps for upgrading Core on a Ubuntu server you can try to see if it fixes the issue.
https://support.nagios.com/kb/article/n ... tml#Ubuntu


You probably have to reinstall the Apache Config Files on your server as they are corrupted/

If you download the Nagios source from the above link and run the following commands, it should reinstall the Apache Config files.

Code: Select all

sudo make install-webconf
sudo a2enmod rewrite
sudo a2enmod cgi

Re: Unable to Update Nagios Core 3.5.1

Posted: Thu Oct 25, 2018 11:44 am
by BrunoLosse1
It worked! Thank you tgriep for the help!

One last thing: If I visit http://localhost/nagios3 it still loads the Version 3.5.1 how can I unistall the old version?

Re: Unable to Update Nagios Core 3.5.1

Posted: Thu Oct 25, 2018 2:37 pm
by tgriep
When you use the old link, does it show version 3.5.1 is running or that it bring you to the new version?
Does the new version have all of the Host and Service checks defined in it?

Make a backup if the server if possible but I am guessing Nagios 3..5.1 was installed using apt so to remove it, you would run this as root.

Code: Select all

apt remove nagios3-core

Re: Unable to Update Nagios Core 3.5.1

Posted: Fri Oct 26, 2018 8:31 am
by BrunoLosse1
It opens like if it is running but my hosts don't show up, they only appear at the right link.
Do you think that there's any problems on letting it in? Because it is finally working and I don't want to mess it up.

Re: Unable to Update Nagios Core 3.5.1

Posted: Fri Oct 26, 2018 10:04 am
by tgriep
If you do not want to remove it, you can stop the 3.5.1 version of Nagios Core and disable it from starting up by running the following as root.

Code: Select all

systemctl stop nagios3.service
systemctl disable nagios3.service
That way you don;t have to worry about the settings getting removed by mistake.