Page 1 of 3
MYSQL password wrong on Backup
Posted: Mon Jan 27, 2014 1:35 pm
by intelXIadmin
Hello,
I recently tried to do a backup using the backup_xi.sh script and got the following error messages. Apparently, our MySQL password is not set the default that the script is expecting. Is there an easy way to change the MySQL password so NagiosXI does fail to run either?
Backing up Core Config Manager (NagiosQL)...
tar: Removing leading `/' from member names
tar: Removing leading `/' from member names
Backing up Nagios Core...
tar: Removing leading `/' from member names
tar: /usr/local/nagios/var/ndo.sock: socket ignored
Backing up Nagios XI...
tar: Removing leading `/' from member names
Backing up MRTG...
tar: Removing leading `/' from member names
Backing up MySQL databases...
mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using password: YES) when trying to connect
Error backing up MySQL database 'nagios' - check the password in this script!
[root@ubitmon-jf scripts]#
Nagios XI Version: 2012R2.7
Redhat Version: 6.3
Regards,
Randy.
Re: MYSQL password wrong on Backup
Posted: Mon Jan 27, 2014 2:02 pm
by scottwilkerson
We did have an bug in the new backup script.
Please unzip the attached and place in /usr/local/nagiosxi/scripts
Re: MYSQL password wrong on Backup
Posted: Tue Jan 28, 2014 12:42 pm
by intelXIadmin
I am getting the same problem. It looks like somehow our MySQL password has changed.
Re: MYSQL password wrong on Backup
Posted: Tue Jan 28, 2014 3:28 pm
by lmiltchev
Can you log in the mysql database manually?
or
What is the password that is set in the "automysqlbackup" script?
Code: Select all
grep -i password= /root/scripts/automysqlbackup | head -n 1
Re: MYSQL password wrong on Backup
Posted: Wed Jan 29, 2014 3:29 am
by WillemDH
Hello,
I've been testing the above attached backup script and I can confirm it seems to be working as expected. There is no longer a password required in the backup script, which is nice.
Added my rsync logic.
Thanks.
Willem
Re: MYSQL password wrong on Backup
Posted: Wed Jan 29, 2014 8:54 am
by scottwilkerson
That was the goal of the change, unfortunately Subversion wasn't playing nice that day, and a few important lines were removed.
The fix in that patch is in the trunk and will be what is used moving forward.
More Backup problems with latest NagiosXI
Posted: Sun Feb 02, 2014 9:07 pm
by Fred Kroeger
A similar problem with the backup script just "appeared" after I upgraded to 2012R2.8c - backups have been working OK until then.
It may have something to do with the error reported in the first line.
Code: Select all
Could not open input file: import_xiconfig.php
Backing up Core Config Manager (NagiosQL)...
tar: Removing leading `/' from member names
tar: Removing leading `/' from member names
Backing up Nagios Core...
tar: Removing leading `/' from member names
tar: /usr/local/nagios/var/ndo.sock: socket ignored
Backing up Nagios XI...
tar: Removing leading `/' from member names
Backing up MRTG...
tar: Removing leading `/' from member names
Backing up MySQL databases...
Error backing up MySQL database 'nagios' - check the password in this script!
I have used the new script supplied in this thread & backup is working correctly now
Code: Select all
Backing up Core Config Manager (NagiosQL)...
tar: Removing leading `/' from member names
tar: Removing leading `/' from member names
Backing up Nagios Core...
tar: Removing leading `/' from member names
tar: /usr/local/nagios/var/ndo.sock: socket ignored
tar: /usr/local/nagios/var: file changed as we read it
Backing up Nagios XI...
tar: Removing leading `/' from member names
Backing up MRTG...
tar: Removing leading `/' from member names
Backing up MySQL databases...
Backing up PostgresQL databases...
Backing up logrotate config files...
Backing up Apache config files...
Compressing backup...
===============
BACKUP COMPLETE
===============
Backup stored in /store/backups/nagiosxi/1391392546.tar.gz
Re: MYSQL password wrong on Backup
Posted: Mon Feb 03, 2014 1:08 am
by Fred Kroeger
Just noticed that this problem in another thread - the only difference is my error message about not finding import_xiconfig.php
Re: MYSQL password wrong on Backup
Posted: Mon Feb 03, 2014 12:20 pm
by lmiltchev
Thanks for the feedback! We will do some more digging and testing to make sure the patch is fixing this issue.
Re: MYSQL password wrong on Backup
Posted: Mon Feb 03, 2014 1:13 pm
by intelXIadmin
Hello,
I tried logging into mysql and I cannot:
[root@ubitmon-jf ~]# mysql -pnagiosxi
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
mysql -pnagiosxi
The backup script appears to be using the standard password:
[root@ubitmon-hf ~]# grep -i password= /root/scripts/automysqlbackup | head -n 1
PASSWORD=nagiosxi
So, if our password has changed for some odd reason, how can I change it back and not cause Nagios to fail?