Error while backup Nagios XI

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
tbyrne
Posts: 39
Joined: Tue Oct 21, 2014 2:02 pm
Location: Bohemia NY

Error while backup Nagios XI

Post by tbyrne »

System: VM of CentOS 6.5 with Nagios XI 2014R2.7 running VMware esxi 6

When I run the backup_xi.sh script as root I receive this error message

"mysqldump: Got error: 130: Incorrect file format 'nagios_commenthistory' when using LOCK TABLES
Error backing up MySQL database 'nagios' - check the password in this script!"

I found this post "by reinaldo.gomes » Thu Sep 11, 2014 4:21 pm "
I tried the repair command suggested in the post
"repair table nagios_comments use_frm \g"
But when I tried running the backup_xi.sh script it failed at the same spot.

I tried running repair_database.sh but this also failed to fix the problem.

Any other suggestions?
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Error while backup Nagios XI

Post by jolson »

Get your XI configuration status:

Code: Select all

php /usr/local/nagiosxi/scripts/import_xiconfig.php > ~/config.dat
Read the file:

Code: Select all

cat ~/config.dat
Using the password from the cfg__db_info__ndoutils__pwd field, let's try accessing the nagios mysql database:

Code: Select all

mysql -u ndoutils --password="XXXXXXX" nagios
Replace "XXXXXXX" with the password specified in the field mentioned above. Do you get an access denied message or does the command log you into mysql properly?
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
tbyrne
Posts: 39
Joined: Tue Oct 21, 2014 2:02 pm
Location: Bohemia NY

Re: Error while backup Nagios XI

Post by tbyrne »

jolson,

Using the password from the cfg__db_info__ndoutils__pwd field I was able to log in to the MYSQL database and show all of the tables, I also performed some query's to just be sure. No problems.
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Error while backup Nagios XI

Post by jolson »

Try issuing the following command:

Code: Select all

echo 'desc nagios_commenthistory' | mysql -uroot -pnagiosxi nagios
If the above doesn't run properly, try running a 'desc nagios_commenthistory' when you're inside of the 'nagios' database. Do your results match mine?
Field Type Null Key Default Extra
commenthistory_id int(11) NO PRI NULL auto_increment
instance_id smallint(6) NO MUL 0
entry_time datetime NO 0000-00-00 00:00:00
entry_time_usec int(11) NO 0
comment_type smallint(6) NO 0
entry_type smallint(6) NO 0
object_id int(11) NO 0
comment_time datetime NO 0000-00-00 00:00:00
internal_comment_id int(11) NO 0
author_name varchar(64) NO
comment_data varchar(255) NO
is_persistent smallint(6) NO 0
comment_source smallint(6) NO 0
expires smallint(6) NO 0
expiration_time datetime NO 0000-00-00 00:00:00
deletion_time datetime NO 0000-00-00 00:00:00
deletion_time_usec int(11) NO 0
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
tbyrne
Posts: 39
Joined: Tue Oct 21, 2014 2:02 pm
Location: Bohemia NY

Re: Error while backup Nagios XI

Post by tbyrne »

Jolson,

That was the problem, my server was missing 'nagios_commenthistory'.
I tried running 'repairmysql.sh nagios nagios_commenthistory' The command showed that the table was missing, I was hoping it would recreate the table but it did not.

I was able to export the table from a lab system and import in to the non-working system. I was then able to run the backup_xi.sh script with our errors.
Would the cause any issues with the nagios xi system if I were to import the backup in to another system?

Thanks for the help.
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Error while backup Nagios XI

Post by jolson »

Would the cause any issues with the nagios xi system if I were to import the backup in to another system?
As long as the backup completed properly and Nagios XI isn't reporting any issues, I don't see a problem with importing the backup into another system.

Glad I could help! May I close this thread?
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
tbyrne
Posts: 39
Joined: Tue Oct 21, 2014 2:02 pm
Location: Bohemia NY

Re: Error while backup Nagios XI

Post by tbyrne »

Jolson,

My system is working fine and the backup completed with our errors.

Thanks for all of the help.

You can close this thread
Locked