Backup errors

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
chrisfritz
Posts: 23
Joined: Thu Dec 09, 2010 11:53 am

Backup errors

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Backup errors

Post by scottwilkerson »

Let's run the following to attempt to repair the crashed tables

Code: Select all

mysqlcheck --auto-repair -A -pnagiosxi
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
chrisfritz
Posts: 23
Joined: Thu Dec 09, 2010 11:53 am

Re: Backup errors

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Backup errors

Post by scottwilkerson »

If you go to Admin, is all of XI System Component Status showing green?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
chrisfritz
Posts: 23
Joined: Thu Dec 09, 2010 11:53 am

Re: Backup errors

Post by chrisfritz »

Yes, everything is green.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Backup errors

Post by scottwilkerson »

Please run

Code: Select all

cd /usr/local/nagiosxi/scripts
./repairmysql.sh nagios
./repairmysql.sh nagiosql
./reconfigure_nagios.sh
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
chrisfritz
Posts: 23
Joined: Thu Dec 09, 2010 11:53 am

Re: Backup errors

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Backup errors

Post by scottwilkerson »

press the enter key, I think it is done..
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
chrisfritz
Posts: 23
Joined: Thu Dec 09, 2010 11:53 am

Re: Backup errors

Post by chrisfritz »

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

Post by scottwilkerson »

Glad to help.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked