Page 1 of 1

Backup errors

Posted: Wed Feb 08, 2012 10:58 am
by chrisfritz
I am attempting to backup NagiosXI (2011R1.9, on CentOS 5.5) using the following command:
/usr/local/nagiosxi/scripts/backup_xi.sh
however it gives an error when it does the mysqldump:
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!

Thank you.

Re: Backup errors

Posted: Wed Feb 08, 2012 11:20 am
by scottwilkerson
Let's run the following to attempt to repair the crashed tables

Code: Select all

mysqlcheck --auto-repair -A -pnagiosxi

Re: Backup errors

Posted: Wed Feb 08, 2012 1:55 pm
by chrisfritz
That solved the mysqldump error, but now for example when I click on hostgroup overview none if the host groups are shown. Is it just slow due to restarting all of the services. I had also ran these commands:

service nagiosxi stop
service npcd stop
service ndo2db stop
service nagios stop
mkdir /root/pre-upgrade-backup
tar cjf /root/pre-upgrade-backup/usr-local-nagios.tar.bz2 /usr/local/nagios
tar cjf /root/pre-upgrade-backup/usr-local-nagiosxi.tar.bz2 /usr/local/nagiosxi
pg_dump -U nagiosxi -c -F p nagiosxi | bzip2 -c > /root/pre-upgrade-backup/pg_nagiosxi.sql.bz2
mysqldump -u root -pnagiosxi nagios | bzip2 -c > /root/pre-upgrade-backup/my_nagios.sql.bz2
mysqldump -u root -pnagiosxi nagiosql | bzip2 -c > /root/pre-upgrade-backup/my_nagiosql.sql.bz2
service nagios start
service ndo2db start
service npcd start
service nagiosxi start

Thank you.

Re: Backup errors

Posted: Wed Feb 08, 2012 2:02 pm
by scottwilkerson
If you go to Admin, is all of XI System Component Status showing green?

Re: Backup errors

Posted: Wed Feb 08, 2012 2:06 pm
by chrisfritz
Yes, everything is green.

Re: Backup errors

Posted: Wed Feb 08, 2012 2:54 pm
by scottwilkerson
Please run

Code: Select all

cd /usr/local/nagiosxi/scripts
./repairmysql.sh nagios
./repairmysql.sh nagiosql
./reconfigure_nagios.sh

Re: Backup errors

Posted: Wed Feb 08, 2012 3:42 pm
by chrisfritz
It seems to be taking a long time on the following at least 30min:

Things look okay - No serious problems were detected during the pre-flight check
RET: 0
Running configuration check...done.
Stopping nagios: .done.
Starting nagios: done.
RESETTING PERMS
/usr/local/nagiosxi/nom/checkpoints/nagioscore /usr/local/nagiosxi/scripts
tar: Removing leading `/' from member names
/usr/local/nagiosxi/scripts

Nothing seems to be hung so I will let it run unless you advise otherwise. Thanks.

Re: Backup errors

Posted: Wed Feb 08, 2012 4:43 pm
by scottwilkerson
press the enter key, I think it is done..

Re: Backup errors

Posted: Wed Feb 08, 2012 4:50 pm
by chrisfritz
Thank you very much we are back online.

Re: Backup errors

Posted: Wed Feb 08, 2012 5:44 pm
by scottwilkerson
Glad to help.