I also get this kind of error when upgrading from 5.11.3 to 2024R1. MySQL password is default, but my DB server is not on the same host and I think they "hardcoded" this into the upgrade script. Please fix this ASAP!
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Nagios xi 2024R1 upgrade issue
-
- Posts: 318
- Joined: Mon Apr 06, 2020 2:49 pm
Re: Nagios xi 2024R1 upgrade issue
Please let us know if you have any other questions or concerns.
-Laura
-Laura
-
- Posts: 5
- Joined: Wed Jul 20, 2022 6:42 am
-
- Posts: 85
- Joined: Thu Jul 28, 2011 11:34 am
Re: Nagios xi 2024R1 upgrade issue
Hey everybody, I'm hoping this is related to my circumstance, but not entirely sure. Approximately a week ago, I attempted to upgrade our TEST and DR systems from R2024r1 to 2024r1.01, and the Database Maintenance alert stayed RED, and I had very little time to debug, but I thought I saw log messages regarding the mysql password for DBMAINT was invalid, or something to that effect. I just decided to restore back to R2024r1, and was expecting to see a new fixed release coming out soon.
Does anyone have a similar experience or advise where to go from here. Is there a post upgrade procedure to resolve this? I could do it again, if more documentation is needed.
Does anyone have a similar experience or advise where to go from here. Is there a post upgrade procedure to resolve this? I could do it again, if more documentation is needed.
-
- Posts: 318
- Joined: Thu Jan 12, 2023 5:42 pm
Re: Nagios xi 2024R1 upgrade issue
Hello @BenCowan,
You can check your passwords with the script /usr/local/nagiosxi/scripts/get_mysql_passwords.sh
You can check your passwords with the script /usr/local/nagiosxi/scripts/get_mysql_passwords.sh
Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.
-
- Posts: 85
- Joined: Thu Jul 28, 2011 11:34 am
Re: Nagios xi 2024R1 upgrade issue
Okay, so I ran that script on my R2024R1 and R2024R1.02 systems and got the same output. I was waiting for another release to see if Nagios fixed this problem, but I'm getting the same errors. What does this mean from the dbmaint.log?:
Database Error: Could not connect to database
Access denied for user 'dbmaint_nagiosxi'@'localhost' (using password: YES)
Mon, 04 Mar 2024 09:15:01 -0800 LOCKFILE '/usr/local/nagiosxi/var/dbmaint.lock' ExiSTS - ExiTING!
Mon, 04 Mar 2024 09:20:01 -0800 LOCKFILE '/usr/local/nagiosxi/var/dbmaint.lock' ExiSTS - ExiTING!
Mon, 04 Mar 2024 09:30:02 -0800 LOCKFILE '/usr/local/nagiosxi/var/dbmaint.lock' ExiSTS - ExiTING!
Mon, 04 Mar 2024 09:35:02 -0800 LOCKFILE '/usr/local/nagiosxi/var/dbmaint.lock' ExiSTS - ExiTING!
Mon, 04 Mar 2024 09:40:01 -0800 LOCKFILE '/usr/local/nagiosxi/var/dbmaint.lock' ExiSTS - ExiTING!
Mon, 04 Mar 2024 09:45:02 -0800 LOCKFILE '/usr/local/nagiosxi/var/dbmaint.lock' IS OLD - REMOVING
Mon, 04 Mar 2024 09:45:02 -0800 CREATING: /usr/local/nagiosxi/var/dbmaint.lock
Database Error: Could not connect to database
Access denied for user 'dbmaint_nagiosxi'@'localhost' (using password: YES)
Database Error: Could not connect to database
Access denied for user 'dbmaint_nagiosxi'@'localhost' (using password: YES)
Mon, 04 Mar 2024 09:15:01 -0800 LOCKFILE '/usr/local/nagiosxi/var/dbmaint.lock' ExiSTS - ExiTING!
Mon, 04 Mar 2024 09:20:01 -0800 LOCKFILE '/usr/local/nagiosxi/var/dbmaint.lock' ExiSTS - ExiTING!
Mon, 04 Mar 2024 09:30:02 -0800 LOCKFILE '/usr/local/nagiosxi/var/dbmaint.lock' ExiSTS - ExiTING!
Mon, 04 Mar 2024 09:35:02 -0800 LOCKFILE '/usr/local/nagiosxi/var/dbmaint.lock' ExiSTS - ExiTING!
Mon, 04 Mar 2024 09:40:01 -0800 LOCKFILE '/usr/local/nagiosxi/var/dbmaint.lock' ExiSTS - ExiTING!
Mon, 04 Mar 2024 09:45:02 -0800 LOCKFILE '/usr/local/nagiosxi/var/dbmaint.lock' IS OLD - REMOVING
Mon, 04 Mar 2024 09:45:02 -0800 CREATING: /usr/local/nagiosxi/var/dbmaint.lock
Database Error: Could not connect to database
Access denied for user 'dbmaint_nagiosxi'@'localhost' (using password: YES)
-
- Posts: 234
- Joined: Wed Aug 09, 2023 10:05 am
Re: Nagios xi 2024R1 upgrade issue
The issue with offloaded databases should be fixed in xi 2024R1.0.2.
Before upgrade, I would verify that your xi instances has the correct root password in both /usr/local/nagiosxi/var/xi-sys.cfg and /usr/local/nagiosxi/etc/xi-sys.cfg under the mysqlpass parameter.
If you source this file, . /usr/local/nagiosxi/var/xi-sys.cfg
You should be able to log in with mysql -u root -p$mysqlpass -h [IP or hostname of mysql database].
If you have an offloaded databases, the root user also needs to have the grant option granted. It sounds goofy but when you grant all permissions to a user, the grant option is not included. So on the machine with the mysql database, you would log into mysql and do something like GRANT ALL ON *.* to root@`[Your xi IP address/hostname]` WITH GRANT OPTION;
-
- Posts: 234
- Joined: Wed Aug 09, 2023 10:05 am
Re: Nagios xi 2024R1 upgrade issue
Another user encountered a similar problem. This is my response.BenCowan wrote: ↑Mon Mar 04, 2024 12:50 pm Okay, so I ran that script on my R2024R1 and R2024R1.02 systems and got the same output. I was waiting for another release to see if Nagios fixed this problem, but I'm getting the same errors. What does this mean from the dbmaint.log?:
Database Error: Could not connect to database
Access denied for user 'dbmaint_nagiosxi'@'localhost' (using password: YES)
Mon, 04 Mar 2024 09:15:01 -0800 LOCKFILE '/usr/local/nagiosxi/var/dbmaint.lock' ExiSTS - ExiTING!
Mon, 04 Mar 2024 09:20:01 -0800 LOCKFILE '/usr/local/nagiosxi/var/dbmaint.lock' ExiSTS - ExiTING!
Mon, 04 Mar 2024 09:30:02 -0800 LOCKFILE '/usr/local/nagiosxi/var/dbmaint.lock' ExiSTS - ExiTING!
Mon, 04 Mar 2024 09:35:02 -0800 LOCKFILE '/usr/local/nagiosxi/var/dbmaint.lock' ExiSTS - ExiTING!
Mon, 04 Mar 2024 09:40:01 -0800 LOCKFILE '/usr/local/nagiosxi/var/dbmaint.lock' ExiSTS - ExiTING!
Mon, 04 Mar 2024 09:45:02 -0800 LOCKFILE '/usr/local/nagiosxi/var/dbmaint.lock' IS OLD - REMOVING
Mon, 04 Mar 2024 09:45:02 -0800 CREATING: /usr/local/nagiosxi/var/dbmaint.lock
Database Error: Could not connect to database
Access denied for user 'dbmaint_nagiosxi'@'localhost' (using password: YES)
viewtopic.php?p=356029#p356029
-
- Posts: 5
- Joined: Wed Jul 20, 2022 6:42 am
Re: Nagios xi 2024R1 upgrade issue
Thank you for letting me know. I successfully upgraded Nagios xi from version 5.11.1 to 2024R1.0.2 with databases on separate MySQL server.danderson wrote: ↑Tue Mar 12, 2024 11:27 amThe issue with offloaded databases should be fixed in xi 2024R1.0.2.
Before upgrade, I would verify that your xi instances has the correct root password in both /usr/local/nagiosxi/var/xi-sys.cfg and /usr/local/nagiosxi/etc/xi-sys.cfg under the mysqlpass parameter.
If you source this file, . /usr/local/nagiosxi/var/xi-sys.cfg
You should be able to log in with mysql -u root -p$mysqlpass -h [IP or hostname of mysql database].
If you have an offloaded databases, the root user also needs to have the grant option granted. It sounds goofy but when you grant all permissions to a user, the grant option is not included. So on the machine with the mysql database, you would log into mysql and do something like GRANT ALL ON *.* to root@`[Your xi IP address/hostname]` WITH GRANT OPTION;