Scheduled Local Backup Failed

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
bseuser
Posts: 39
Joined: Thu Jul 02, 2020 2:33 am

Scheduled Local Backup Failed

Post 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,
User avatar
lgute
Posts: 411
Joined: Mon Apr 06, 2020 2:49 pm

Re: Scheduled Local Backup Failed

Post 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.
Please let us know if you have any other questions or concerns.

-Laura
bbahn
Posts: 380
Joined: Thu Jan 12, 2023 5:42 pm

Re: Scheduled Local Backup Failed

Post 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
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.
bseuser
Posts: 39
Joined: Thu Jul 02, 2020 2:33 am

Re: Scheduled Local Backup Failed

Post 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.
bseuser
Posts: 39
Joined: Thu Jul 02, 2020 2:33 am

Re: Scheduled Local Backup Failed

Post 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,
Post Reply