Page 1 of 1

Scheduled Local Backup Failed

Posted: Wed Aug 16, 2023 5:46 am
by bseuser
Hello,

I see the scheduled backup is getting failed very frequently with the below message.

------------
The scheduled local backup at 2023-08-14 05:55:03 failed.

Last output from the system:


View your full scheduled backup logs at /usr/local/nagiosxi/var/components/scheduledbackups.log to find out more details about the error. Your backup may have timed out, you can set a backup_timeout variable in config.inc.php to increase it.
------------

Logs for reference.
# cat /usr/local/nagiosxi/var/components/scheduledbackups.log
No entry for terminal type "unknown";
using dumb terminal settings.
\nStarting new backup....\n
Backing up Nagios Core...
tar: Removing leading `/' from member names
tar: /usr/local/nagios/var/rw/nagios.qh: socket ignored
tar: /usr/local/nagios/var: file changed as we read it
Backing up Nagios XI...
tar: Removing leading `/' from member names
tar: /usr/local/nagiosxi/var/sysstat.log: file changed as we read it
tar: /usr/local/nagiosxi/var/eventman.log: file changed as we read it
tar: /usr/local/nagiosxi/var: file changed as we read it
Backing up MRTG...
tar: Removing leading `/' from member names
Backing up the SNMP directories
tar: Removing leading `/' from member names
tar: Removing leading `/' from member names
Backing up NRDP...
tar: Removing leading `/' from member names
Backing up Nagvis...
tar: Removing leading `/' from member names
Backing up nagios user home dir...
tar: Removing leading `/' from member names
Backing up MySQL databases...
mysqldump: Got error: 144: "Table './nagios/nagios_statehistory' is marked as crashed and last (automatic?) repair failed" when using LOCK TABLES
Error backing up MySQL database 'nagios' - check the password in this script!

--------------

-The previous post (from 2014) related to mysql password issues did not help me, can you let me know how to fix this issue?
-The MySQL database password hardcoded anywhere?

Thanks,

Re: Scheduled Local Backup Failed

Posted: Thu Aug 17, 2023 9:47 am
by lgute
Hi @bseuser, thanks for reaching out.

Try the following...

Log into the terminal as root and run the following command:

Code: Select all

/usr/local/nagiosxi/scripts/repair_databases.sh
If you are still having issues, try the following command.

Code: Select all

mysqlcheck -r -f -uroot -pnagiosxi --all-databases --use_frm
If the issue persists, please send us your system profile (if you can access through the XI interface).

To send us your system profile.
Login to the Nagios XI GUI using a web browser
Click the "Admin" > "System Profile" Menu
Click the "Download Profile" button
Save the profile.zip file and share this in a private message and then reply to this post to bring it up in the queue.

Re: Scheduled Local Backup Failed

Posted: Thu Aug 17, 2023 10:07 am
by bbahn
Hello bseuser,

From your log, it seems that your database (or at least one of your tables) is corrupted.
mysqldump: Got error: 144: "Table './nagios/nagios_statehistory' is marked as crashed and last (automatic?) repair failed" when using LOCK TABLES
This indicates that the table/database may be corrupted. You can try repairing the database:
https://assets.nagios.com/downloads/nag ... tabase.pdf

This may be the actual cause of your failed backup and not the password as the log hint suggested.

-Blake Bahner

Re: Scheduled Local Backup Failed

Posted: Fri Sep 08, 2023 6:29 am
by bseuser
Hi,@lgute I tried repairing the DB with the commands you mentioned. Still i am facing the same issue sent you the system profile in a private message.

Re: Scheduled Local Backup Failed

Posted: Mon Sep 11, 2023 7:57 am
by bseuser
Hi @lgute
This issue still persists i shared the system profile with you in a private message. Can you review and suggest the next steps?
Thanks,