Unable to run backups

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
bcamp
Posts: 30
Joined: Thu May 23, 2013 2:54 pm

Unable to run backups

Post by bcamp »

Good morning. I'm having an issue running backups on my XI installation. It looks like I may be running into two different errors, I'm not sure if they're related. This is what I run into when I run the backup_xi.sh as root.

Code: Select all

Backing up MySQL databases...
mysqldump: Got error: 130: Incorrect file format 'nagios_notifications' when using LOCK TABLES
Error backing up MySQL database 'nagios' - check the password in this script!
I haven't changed any passwords. It's strange, it was working one day and then just stopped. No updates had happened, I hadn't made any config changes.

I'm currently running XI 2014 R1.1. This error is preventing me from running an upgrade. CentOS 6.5, fully up to date.

I have tried repairing the database, as well as truncating the nagios_notifications table and going through the repair procedure again. The repairmysql.sh script completes successfully with no errors, but neither repairing nor truncating the complaining table has changed anything.

I'm able to manually log in to mysql when using the credentials found in ndo2db.cfg, but I'm not sure if that's the user and password used for the backup. I'm not able to find for sure where the script was pulling the credential set from.
bcamp
Posts: 30
Joined: Thu May 23, 2013 2:54 pm

Re: Unable to run backups

Post by bcamp »

Uploading system profile attachment.

The sql errors in the systemlog.txt at 9:22 were happening when I had to reset my sql root password. Apparently, I had forgotten what it was while I was gone on vacation. :roll:
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Unable to run backups

Post by lmiltchev »

What is the password listed in the "restore_xi.sh"?

Code: Select all

grep "mysqlpass=" /usr/local/nagiosxi/scripts/restore_xi.sh
In "automysqlbackup"?

Code: Select all

grep "PASSWORD=" /root/scripts/automysqlbackup
Can you log in mysql with these passwords?

Code: Select all

mysql -p<password>
Be sure to check out our Knowledgebase for helpful articles and solutions!
bcamp
Posts: 30
Joined: Thu May 23, 2013 2:54 pm

Re: Unable to run backups

Post by bcamp »

Both scripts return nagiosxi as the password.

I am unable to log into mysql with that password. I've tried logging in as user nagios, myself, root, and ndoutils. The password didn't work for any of those users.

I tried updating the automysqlbackup to my sql root password (which I have changed, if that helps), but it still returns the same error. I set the password value back in automysqlbackup to the original value once that failed.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Unable to run backups

Post by lmiltchev »

If you don't remember your mysql root password, you can try resetting it, by following the steps, outlined here:

http://www.cyberciti.biz/tips/recover-m ... sword.html
Be sure to check out our Knowledgebase for helpful articles and solutions!
bcamp
Posts: 30
Joined: Thu May 23, 2013 2:54 pm

Re: Unable to run backups

Post by bcamp »

Sorry, I was in a bit of a hurry and wrote my previous reply in a rush. Reading what I said, I don't think I was very clear.
I had to reset the root password to sql earlier this morning. I reset it just like the article you linked says to do it. That's fine, I know the root password. I've been having this problem for a few days, it didn't just start today.

So, both files return 'nagiosxi' as the sql password for root.

Code: Select all

# grep "PASSWORD=" /root/scripts/automysqlbackup
PASSWORD=nagiosxi

Code: Select all

# grep "mysqlpass=" /usr/local/nagiosxi/scripts/restore_xi.sh
mysqlpass="nagiosxi"
I tried updating the value in /root/scripts/automysqlbackup to match my new root sql password, but I still received the errors. I set the value back to the original 'nagiosxi' after testing that. I also set the root sql password to 'nagiosxi' to match the scripts, but I still got the errors.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Unable to run backups

Post by lmiltchev »

Can you log in mysql successfully with your "new" password?

Code: Select all

mysql -p<new password>
What are the errors that you are getting at the moment?
Be sure to check out our Knowledgebase for helpful articles and solutions!
bcamp
Posts: 30
Joined: Thu May 23, 2013 2:54 pm

Re: Unable to run backups

Post by bcamp »

lmiltchev wrote:Can you log in mysql successfully with your "new" password?

Code: Select all

mysql -p<new password>
Yes.

Code: Select all

# mysql -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 38279
Server version: 5.1.73 Source distribution

Copyright ......

mysql>
lmiltchev wrote:What are the errors that you are getting at the moment?

Code: Select all

# ./backup_xi.sh
............
Backing up MySQL databases...
mysqldump: Got error: 130: Incorrect file format 'nagios_notifications' when using LOCK TABLES
Error backing up MySQL database 'nagios' - check the password in this script!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Unable to run backups

Post by lmiltchev »

Have you modified any of the passwords in the "/usr/local/nagiosxi/html/config.inc.php"? What do you have under the "// db-specific connection information" section?
Be sure to check out our Knowledgebase for helpful articles and solutions!
bcamp
Posts: 30
Joined: Thu May 23, 2013 2:54 pm

Re: Unable to run backups

Post by bcamp »

lmiltchev wrote:Have you modified any of the passwords in the "/usr/local/nagiosxi/html/config.inc.php"?
No, I haven't modified anything in that file.
lmiltchev wrote:What do you have under the "// db-specific connection information" section?

Code: Select all

// db-specific connection information
$cfg['db_info']=array(
        "nagiosxi" => array(
                "dbtype" => 'pgsql',
                "dbserver" => 'localhost',
                "user" => 'nagiosxi',
                "pwd" => 'n@gweb',
                "db" => 'nagiosxi',
                "dbmaint" => array(             // variables affecting maintenance of db
                        "max_auditlog_age" => 30, // max time (in DAYS) to keep audit log entries
                        "max_commands_age" => 480, // max time (minutes) to keep commands
                        "max_events_age" => 480, // max time (minutes) to keep events
                        "optimize_interval" => 60, // time (in minutes) between db optimization runs
                        "repair_interval" => 0, // time (in minutes) between db repair runs
                        ),
                ),
        "ndoutils" => array(
                "dbtype" => 'mysql',
                "dbserver" => 'localhost',
                "user" => 'ndoutils',
                "pwd" => 'n@gweb',
                "db" => 'nagios',
                "dbmaint" => array(             // variables affecting maintenance of ndoutils db

                        "max_externalcommands_age" => 7, // max time (in DAYS) to keep external commands
                        "max_logentries_age" => 90, // max time (in DAYS) to keep log entries
                        "max_statehistory_age" => 730, // max time (in DAYS) to keep state history information
                        "max_notifications_age" => 90, // max time (in DAYS) to keep notifications
                        "max_timedevents_age" => 5, // max time (minutes) to keep timed events
                        "max_systemcommands_age" => 5, // max time (minutes) to keep system commands
                        "max_servicechecks_age" => 5, // max time (minutes) to keep service checks
                        "max_hostchecks_age" => 5, // max time (minutes) to keep host checks
                        "max_eventhandlers_age" => 5, // max time (minutes) to keep event handlers
                        "optimize_interval" => 60, // time (in minutes) between db optimization runs
                        "repair_interval" => 0, // time (in minutes) between db repair runs
                        ),
                ),
        "nagiosql" => array(
                "dbtype" => 'mysql',
                "dbserver" => 'localhost',
                "user" => 'nagiosql',
                "pwd" => 'n@gweb',
                "db" => 'nagiosql',
                "dbmaint" => array(             // variables affecting maintenance of db
                        "max_logbook_age" => 480, // max time (minutes) to keep log book records
                        "optimize_interval" => 60, // time (in minutes) between db optimization runs
                        "repair_interval" => 0, // time (in minutes) between db repair runs
                        ),
                ),

Locked