Backup errors
-
chrisfritz
- Posts: 23
- Joined: Thu Dec 09, 2010 11:53 am
Backup errors
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.
/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.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Backup errors
Let's run the following to attempt to repair the crashed tables
Code: Select all
mysqlcheck --auto-repair -A -pnagiosxi-
chrisfritz
- Posts: 23
- Joined: Thu Dec 09, 2010 11:53 am
Re: Backup errors
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.
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.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Backup errors
If you go to Admin, is all of XI System Component Status showing green?
-
chrisfritz
- Posts: 23
- Joined: Thu Dec 09, 2010 11:53 am
Re: Backup errors
Yes, everything is green.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Backup errors
Please run
Code: Select all
cd /usr/local/nagiosxi/scripts
./repairmysql.sh nagios
./repairmysql.sh nagiosql
./reconfigure_nagios.sh-
chrisfritz
- Posts: 23
- Joined: Thu Dec 09, 2010 11:53 am
Re: Backup errors
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.
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.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Backup errors
press the enter key, I think it is done..
-
chrisfritz
- Posts: 23
- Joined: Thu Dec 09, 2010 11:53 am
Re: Backup errors
Thank you very much we are back online.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Backup errors
Glad to help.