Upgrade from 5.11.1 to 5.11.2 fails

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
jacek
Posts: 245
Joined: Wed Sep 09, 2015 5:49 am

Upgrade from 5.11.1 to 5.11.2 fails

Post by jacek »

The upgrade fails due to the logrotate.service not being found here:
/usr/lib/systemd/system/logrotate.service
mine is in:
/lib/systemd/system/logrotate.service

The logrotate service is failing:

Code: Select all

Sep 12 12:25:35 STGNAGIOS01.thule.com logrotate[175316]: error: nagiosxi:1 unknown option 'PRODDIR' -- ignoring line
Sep 12 12:25:35 STGNAGIOS01.thule.com logrotate[175316]: error: nagiosxi:6 unknown user 'NAGIOSUSER'
Sep 12 12:25:35 STGNAGIOS01.thule.com logrotate[175316]: error: found error in file nagiosxi, skipping
Any ideas why that is?

Code: Select all

Running upgrade
Nagios XI Upgrade Log
==========================
DATE: Tue 12 Sep 2023 11:46:57 AM UTC

DISTRO INFO:
Ubuntu
20.04
x86_64


Archive:  sourceguardian/ixed4.lin.x86-64.zip
  inflating: /usr/lib/php/20190902/ixed.7.4.lin
Sourceguardian extension found for PHP version 7.4
Sourceguardian extension already in php.ini
Checking required prereqs...
Please wait...

OLD VERSION: 51101
grep: /usr/lib/systemd/system/logrotate.service: No such file or directory
./upgrade: line 2477: /usr/lib/systemd/system/logrotate.service: No such file or directory
sgardil
Posts: 143
Joined: Wed Aug 09, 2023 9:58 am

Re: Upgrade from 5.11.1 to 5.11.2 fails

Post by sgardil »

Hey @Jacek, thanks for reaching out.

That is an interesting one that I haven't seen before so I am unsure why your logrotate.service file is in a different location. One possible solution could be to create a symlink so that it will be accessible in /usr/lib/systemd/system/. Like always before modifying your system make sure to have a working backup to restore from if anything breaks. To make the symlink copy this into the terminal:

Code: Select all

ln -s /lib/systemd/system/logrotate.service /usr/lib/systemd/system/logrotate.service
Let me know if this fixes the issue for you.
-Sgardil
jacek
Posts: 245
Joined: Wed Sep 09, 2015 5:49 am

Re: Upgrade from 5.11.1 to 5.11.2 fails

Post by jacek »

To be honest, I'm also not sure why that is.
Our nagios server was CentOS, but then we migrated to Ubuntu, and I'm quite convinced we started with 20 LTS version.

The symlink did do the trick and I upgraded without issues, but this still doesn't explain why things look as they do.
Do you have any idea what lead to this?
Maybe I should just go with an upgrade to 22 LTS (which I plan to do anyway), is there anything to bear in mind while doing this? Maybe something that needs to be run post upgrade?

BTW, the logrotate errors stating it doesn't know PRODDIR option or the NAGIOSUSER user - the whole nagiosxi config file in logrotate.d had these variables instead of the real data (apache user, nagios group and proddir).
I fixed that and started logrotate successfully.
sgardil
Posts: 143
Joined: Wed Aug 09, 2023 9:58 am

Re: Upgrade from 5.11.1 to 5.11.2 fails

Post by sgardil »

That's awesome that you were able to fix the logrotate errors. To be honest I wouldn't be able to give a concrete reason as to what could have lead to this happening. One of the nice things with Nagios is that it can be really configurable, however this can also create unique situations were things interact differently. It's possible that restoring from a backup on different distros could have created this strange interaction due to the differences between Centos and Ubuntu.

Would you be doing another backup restore to go 22 LTS? Here is some documentation on restoring from backups. There shouldn't be anything that needs to be ran post upgrade however if you are going to restore from a back up the safest route would be to make sure the versions of XI are the same across the distros before backing up and then testing that the backup restore went well with no issues. As always make sure you have sufficient back ups when doing this process and if you have any issues during the process feel free to reach out.
jacek
Posts: 245
Joined: Wed Sep 09, 2015 5:49 am

Re: Upgrade from 5.11.1 to 5.11.2 fails

Post by jacek »

No, I think I would go with an upgrade, so no nagios recovery would be needed.
If there is nothing from Nagios I need to think about, then I will proceed with the upgrade in some time.
Anyhow, thanks for the workaround, if its all from your side, then we can close this one :)
Post Reply