ndo2db error in /var/log/message

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
sagarjatti
Posts: 25
Joined: Fri Nov 02, 2012 8:25 am

ndo2db error in /var/log/message

Post by sagarjatti »

Hi All,

We are getting some error messages in /var/log/messages like as below.

ndo2db : MYSQL Error : ' incorrect file format 'nagios_systemcommands' '

Can anyone help me to fix this issue? I tried to repair the this table and entire nagios but there is no luck for me.

YOur immediate help will be appreciated much ... :)
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: ndo2db error in /var/log/message

Post by scottwilkerson »

By default XI systems have this DB backed up in
/store/backups/mysql/daily/nagios
/store/backups/mysql/weekly/nagios
/store/backups/mysql/monthly/nagios

Do you have these?

If so they are just gzip, and are created on a daily cron, here is an example restore of the nagios DB

Code: Select all

[root@localhost nagios]# cd /store/backups/mysql/daily/nagios
[root@localhost nagios]# ls -l
total 28264
-rw-r--r-- 1 root root 4421384 Apr 12 07:00 nagios_2013-04-12_07h00m.Friday.sql.gz
-rw-r--r-- 1 root root 4692986 Apr 17 07:00 nagios_2013-04-17_07h00m.Wednesday.sql.gz
-rw-r--r-- 1 root root 4789457 Apr 18 07:00 nagios_2013-04-18_07h00m.Thursday.sql.gz
-rw-r--r-- 1 root root 4941059 Apr 21 07:00 nagios_2013-04-21_07h00m.Sunday.sql.gz
-rw-r--r-- 1 root root 4998263 Apr 22 07:00 nagios_2013-04-22_07h00m.Monday.sql.gz
-rw-r--r-- 1 root root 5084448 Apr 23 07:00 nagios_2013-04-23_07h00m.Tuesday.sql.gz
[root@localhost nagios]# gunzip nagios_2013-04-23_07h00m.Tuesday.sql.gz
[root@localhost nagios]# cat nagios_2013-04-23_07h00m.Tuesday.sql | mysql -pnagiosxi nagios
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
sagarjatti
Posts: 25
Joined: Fri Nov 02, 2012 8:25 am

Re: ndo2db error in /var/log/message

Post by sagarjatti »

Hi Scottwilkerson,

Thank you for your response, i am having this kind of error messages in /var/log/messages from last 1 month or so . I just want to know how can i fix nagios_systemcommands table which is showing as "Incorrect file format".

If i restore the backup file it is same error we will be having in logs again because this error is appearing from last 1 month or so.

Could you please help me to fix this issue bu repairing the table?i tried to repair it but no luck :cry:

Thanks in Advance... :) your help will be appreciated much :)

Regards,
Sagar
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: ndo2db error in /var/log/message

Post by lmiltchev »

How did you repair the database? Did you run the following commands?

Code: Select all

cd /usr/local/nagiosxi/scripts
./repairmysql.sh nagios
Do you have any errors in the mysqld.log at the moment?

Code: Select all

tail -20 /var/log/mysqld.log
What is the output of the following command?

Code: Select all

echo 'check table nagios_systemcommands;' | mysql -t -pnagiosxi nagios
Be sure to check out our Knowledgebase for helpful articles and solutions!
sagarjatti
Posts: 25
Joined: Fri Nov 02, 2012 8:25 am

Re: ndo2db error in /var/log/message

Post by sagarjatti »

Hi lmiltchev,

* Yes i do repair table by using repairmysql.sh script .

* I don't see any error message in /var/log/mysqld.log

* when i ru nthe command i get below output

-----------------------------------------------------------------------------------------------------------------------------
Table | Op | Msg Type | Msg_text |
-----------------------------------------------------------------------------------------------------------------------------nagios.nagios_systemcommands | Check | Error | Incorrect File format 'nagios_systemcommands' |
nagios.nagios_systemcommands | Check | Error | Corrupt |
-----------------------------------------------------------------------------------------------------------------------------


Regards,
Sagar
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: ndo2db error in /var/log/message

Post by abrist »

Try the following command:

Code: Select all

echo "repair table nagios.nagios_systemcommands use_frm;" | mysql -pnagiosxi 
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
sagarjatti
Posts: 25
Joined: Fri Nov 02, 2012 8:25 am

Re: ndo2db error in /var/log/message

Post by sagarjatti »

Hi abrist,

I ran the command as you provided and for miute or so there was no erros in the /var/log/messages but after some time again it started giving same error
"localhost ndo2db: mysql_error ' Incorrect file format 'nagios_systemcommands' ' "
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: ndo2db error in /var/log/message

Post by sreinhardt »

Let's check the most common cause of this:

Code: Select all

df -h
df -i
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
sagarjatti
Posts: 25
Joined: Fri Nov 02, 2012 8:25 am

Re: ndo2db error in /var/log/message

Post by sagarjatti »

There is enough space in the disk i don't think these commands will help.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: ndo2db error in /var/log/message

Post by tmcdonald »

There may be enough space, but if you have many, many small files then you may be out of inodes. The "df -i" command will show this.
Former Nagios employee
Locked