Updating Nagios xi after migrating to a new Linux
-
- Posts: 11
- Joined: Mon Jul 21, 2014 9:55 pm
Updating Nagios xi after migrating to a new Linux
Currently have migrated Nagios xi to a new Linux server. Both servers are running version 5.5.11. Attempting to now update the new server to the latest version, but running into various issues. I didn't swap the IP's of the new servers & was wondering if that would have anything to do wi/ it. If not, help will greatly be appreciated as I can provide more details if necessary.
-
- Posts: 11
- Joined: Mon Jul 21, 2014 9:55 pm
Re: Updating Nagios xi after migrating to a new Linux
Tried updating & receiving the following:
SQL Error [nagiosxi] : You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE user_id = 2' at line 3
& Nagios is pretty much not usable at that point even though the web interface is still up.
SQL Error [nagiosxi] : You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE user_id = 2' at line 3
& Nagios is pretty much not usable at that point even though the web interface is still up.
-
- Posts: 1253
- Joined: Tue Mar 02, 2021 11:15 am
Re: Updating Nagios xi after migrating to a new Linux
Hi,
It does not look like a problem caused by the IP change, but you should check this anyway:
After changing the IP address on your server you should check that the Program URL is correct.
the user.
You should upgrade in "smaller steps". Something like:
5.5.11 --> 5.6.9
5.6.9 --> 5.7.4
5.7.4 --> 5.8.6
After each upgrade make sure to check that it runs, you can login, etc.
The versions of xi can be downloaded from:
https://www.nagios.com/downloads/nagios ... -releases/
Thanks
It does not look like a problem caused by the IP change, but you should check this anyway:
After changing the IP address on your server you should check that the Program URL is correct.
The db error seems to be the cause of the issue, looking like it can't identifyAdmin > System Config > System Settings
General tab
Make sure the Program URL is correct.
If a DNS entry is used make sure that this resolves to your new IP address.
the user.
You should upgrade in "smaller steps". Something like:
5.5.11 --> 5.6.9
5.6.9 --> 5.7.4
5.7.4 --> 5.8.6
After each upgrade make sure to check that it runs, you can login, etc.
The versions of xi can be downloaded from:
https://www.nagios.com/downloads/nagios ... -releases/
Thanks
-
- Posts: 11
- Joined: Mon Jul 21, 2014 9:55 pm
Re: Updating Nagios xi after migrating to a new Linux
Yea I think the db issue is what's holding me back. LEt me try your suggestion of upgrading in smaller steps & I'll get back to you. Thanks again for the input.
-
- Posts: 11
- Joined: Mon Jul 21, 2014 9:55 pm
Re: Updating Nagios xi after migrating to a new Linux
I tried updating to 5.6.9. While I don't get the SQL/db error in the web interface, it looks like the update is still not completing successfully. At the very end, this is what I get instead of a 'successful upgrade' prompt:
make[1]: Leaving directory `/tmp/nagiosxi/subcomponents/nagioscore/nagios-4.4.5'
/usr/bin/install -c -m 755 -d -o root -g root /lib/systemd/system
/usr/bin/install -c -m 755 -o root -g root startup/default-service /lib/systemd/system/nagios.service
Job for nagios.service failed because the control process exited with error code. See "systemctl status nagios.service" and "journalctl -xe" for details.
[root@nagiosxi nagiosxi]#
make[1]: Leaving directory `/tmp/nagiosxi/subcomponents/nagioscore/nagios-4.4.5'
/usr/bin/install -c -m 755 -d -o root -g root /lib/systemd/system
/usr/bin/install -c -m 755 -o root -g root startup/default-service /lib/systemd/system/nagios.service
Job for nagios.service failed because the control process exited with error code. See "systemctl status nagios.service" and "journalctl -xe" for details.
[root@nagiosxi nagiosxi]#
-
- Posts: 1253
- Joined: Tue Mar 02, 2021 11:15 am
Re: Updating Nagios xi after migrating to a new Linux
Hi,
Well that's no fun.
Could you run these two commands and provide the output:
If the output contains any sensitive information you can send it
to me via a PM on here.
Thanks
Well that's no fun.
Could you run these two commands and provide the output:
Code: Select all
systemctl status nagios.service
journalctl -xe
to me via a PM on here.
Thanks
-
- Posts: 11
- Joined: Mon Jul 21, 2014 9:55 pm
Re: Updating Nagios xi after migrating to a new Linux
PM'd you. Also, could a potential reason be a different of databases? I read somewhere that anything beforoe 5.5 uses a different database & might have to be offloaded? Is there a way I can confirm this if that's a potential reason?
-
- Posts: 1253
- Joined: Tue Mar 02, 2021 11:15 am
Re: Updating Nagios xi after migrating to a new Linux
Hi,
Good catch.
Nagios xi users 3 separate databases, nagios, nagiosql & nagisoxi respectively. Prior to version 5.5, the nagiosxi database used postgreSQL. Updates on those versions will preserve the postgreSQL database.
To determine what your system has, run the following command. If it outputs 2, then your server is using postgreSQL and MySQL.
If it outputs 3 then all three dbs are MySQL.
Let me know what the output is.
Thanks
Good catch.
Nagios xi users 3 separate databases, nagios, nagiosql & nagisoxi respectively. Prior to version 5.5, the nagiosxi database used postgreSQL. Updates on those versions will preserve the postgreSQL database.
To determine what your system has, run the following command. If it outputs 2, then your server is using postgreSQL and MySQL.
If it outputs 3 then all three dbs are MySQL.
Code: Select all
grep mysql /usr/local/nagiosxi/html/config.inc.php | wc -l
Thanks
-
- Posts: 11
- Joined: Mon Jul 21, 2014 9:55 pm
Re: Updating Nagios xi after migrating to a new Linux
The output is 3.
-
- Posts: 1253
- Joined: Tue Mar 02, 2021 11:15 am
Re: Updating Nagios xi after migrating to a new Linux
Hi
OK. That means you are running all MySQL.
Let's see if there is an issue with your current 5.5.1 databases.
Please use this as guidance: https://assets.nagios.com/downloads/nag ... tabase.pdf
Essentially it has you take a backup and run:
So in the document you are pretty much done at the end of the green text, no need to go
through the steps in red.
try to upgrade 5.5.11 --> 5.6.9
Thanks
OK. That means you are running all MySQL.
Let's see if there is an issue with your current 5.5.1 databases.
Please use this as guidance: https://assets.nagios.com/downloads/nag ... tabase.pdf
Essentially it has you take a backup and run:
Code: Select all
/usr/local/nagiosxi/scripts/repair_databases.sh
through the steps in red.
Please let me know how you make out. If there were repairs made please take another back-up andRepairing MySQL Tables
Establish a terminal session to your Nagios xi server as the root user.
Versions Of Nagios xi 2014 Onwards
Execute the following command:
/usr/local/nagiosxi/scripts/repair_databases.sh
This script which will automatically repair all databases (nagios, nagiosql) (nagiosxi in xi 5.x). Once the
script has completed, please review all of the output generated for any errors. For any errors please refer to
the troubleshooting section in this document.
Versions Of Nagios xi BEFORE 2014
Stop the MySQL database server with the following command:
service mysqld stop
Run the Nagios xi database repair script with the following command:
try to upgrade 5.5.11 --> 5.6.9
Thanks