Page 1 of 1

Error while backing up Nagios

Posted: Thu Sep 11, 2014 4:21 pm
by reinaldo.gomes
I tried to run the 'backup_xi.sh" script as root, and i got this error:

Code: Select all

[root@localhost scripts]# ./backup_xi.sh
Backing up Core Config Manager (NagiosQL)...
tar: Removing leading `/' from member names
tar: Removing leading `/' from member names
Backing up Nagios Core...
tar: Removing leading `/' from member names
tar: /usr/local/nagios/var/spool/perfdata/1410468728.perfdata.service: File removed before we read it
tar: /usr/local/nagios/var/spool/perfdata: file changed as we read it
tar: /usr/local/nagios/var/rw/live: socket ignored
tar: /usr/local/nagios/var/ndo.sock: socket ignored
tar: /usr/local/nagios/var: file changed as we read it
tar: /usr/local/nagios/share/perfdata/APP5/Usage_-_Disks.rrd: file changed as we read it
tar: /usr/local/nagios/share/perfdata/APP5: file changed as we read it
tar: /usr/local/nagios/share/perfdata/APU8: file changed as we read it
Backing up Nagios XI...
tar: Removing leading `/' from member names
Backing up MRTG...
tar: Removing leading `/' from member names
Backing up MySQL databases...
mysqldump: Got error: 130: Incorrect file format 'nagios_comments' when using LOCK TABLES
Error backing up MySQL database 'nagios' - check the password in this script!
I checked the root password for MySql and it's the default password 'nagiosxi' as described in this doc:
http://assets.nagios.com/downloads/nagi ... ios-XI.pdf

By the way, there's no "mysqlpass= definition" anywhere in this script on my Nagios 2012R2.9, regardless of what the above document states.

I searched for the "incorrect file format" error, and I read about repairing the given table, but it didn't seem to work, as I got the very same "incorrect file format" error after running the repair (unless I did something wrong):

Code: Select all

[root@localhost scripts]# mysql -uroot -pnagiosxi
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11562
Server version: 5.1.71 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> repair nagios_comments use_frm
With or without the "use_frm" part, it doesn't seem to help.

Any ideas?

Re: Error while backing up Nagios

Posted: Fri Sep 12, 2014 12:28 pm
by reinaldo.gomes
It turns out that I was using the wrong command. Instead of:

Code: Select all

mysql> repair nagios_comments use_frm
I should be using:

Code: Select all

mysql> repair table nagios_comments use_frm \g
After repairing all the corrupted tables, the backup was completed successfully.
Just in case anyone runs into the same issue...