SQL error message after logging into new installation
SQL error message after logging into new installation
1. CentOS 6.0
2. 32-bit
3. VMware image from Nagios
4. No special configurations. Nothing has been done on the machine after installing Nagios.
After logging into Nagios XI, I receive an error message:
SQL: SQL Error [ndoutils] : Incorrect file format 'nagios_programstatus' SQL: SQL Error [ndoutils] : Incorrect file format 'nagios_programstatus'
I searched the Internet and found a PDF from Nagios that discussed running the following commands to repair the database. I ran them successfully but the error is still generated every time I log in:
service mysqld stop
/usr/local/nagiosxi/scripts/repairmysql.sh nagios *
service mysqld start
I searched the forum using keywords but didn't find any other post about this error message.
Do you know what the reason is and how I can resolve it? Thanks.
2. 32-bit
3. VMware image from Nagios
4. No special configurations. Nothing has been done on the machine after installing Nagios.
After logging into Nagios XI, I receive an error message:
SQL: SQL Error [ndoutils] : Incorrect file format 'nagios_programstatus' SQL: SQL Error [ndoutils] : Incorrect file format 'nagios_programstatus'
I searched the Internet and found a PDF from Nagios that discussed running the following commands to repair the database. I ran them successfully but the error is still generated every time I log in:
service mysqld stop
/usr/local/nagiosxi/scripts/repairmysql.sh nagios *
service mysqld start
I searched the forum using keywords but didn't find any other post about this error message.
Do you know what the reason is and how I can resolve it? Thanks.
Re: SQL error message after logging into new installation
If you saw something similar to this:
Hope this helps.
then, you may need to run a force repair on the tables:SQL: DELETE FROM nagios_logentries WHERE logentry_time < FROM_UNIXTIME(1293570334)
SQL: SQL Error [ndoutils] :</b> Table './nagios/nagios_logentries' is marked
as crashed and last (automatic?) repair failedCLEANING ndoutils TABLE 'notifications'...
Code: Select all
service mysqld stop
cd /var/lib/mysql/nagios
myisamchk -r -f nagios_<corrupted_table>
service mysqld start
rm -f /usr/local/nagiosxi/var/dbmaint.lock
/usr/local/nagiosxi/cron/dbmaint.php Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: SQL error message after logging into new installation
Thanks for the quick reply. I was hesitant to apply the suggestion because I didn't receive the kind of error you referenced. In any case, I tried to apply the suggestion but encountered the following error:
[root@mynagios ~]# service mysqld stop
Stopping mysqld: [ OK ]
[root@mynagios ~]# cd /var/lib/mysql/nagios
[root@mynagios nagios]# myisamchk -r -f nagios_programstatus
myisamchk: error: 'nagios_programstatus' is not a MyISAM-table
Am I not referencing the table correctly? From the error message that I mentioned, it appears the table's name is nagios_programstatus.
[root@mynagios ~]# service mysqld stop
Stopping mysqld: [ OK ]
[root@mynagios ~]# cd /var/lib/mysql/nagios
[root@mynagios nagios]# myisamchk -r -f nagios_programstatus
myisamchk: error: 'nagios_programstatus' is not a MyISAM-table
Am I not referencing the table correctly? From the error message that I mentioned, it appears the table's name is nagios_programstatus.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: SQL error message after logging into new installation
Run this command as root and report the output
Code: Select all
echo "USE nagios;show tables where Tables_in_nagios='nagios_programstatus';" |mysql -pnagiosxiRe: SQL error message after logging into new installation
Here is the result of the command:
[root@mynagios ~]# echo "USE nagios;show tables where Tables_in_nagios='nagios_programstatus';" | mysql -pnagiosxi
Tables_in_nagios
nagios_programstatus
Looks like there is a table named nagios_programstatus.
[root@mynagios ~]# echo "USE nagios;show tables where Tables_in_nagios='nagios_programstatus';" | mysql -pnagiosxi
Tables_in_nagios
nagios_programstatus
Looks like there is a table named nagios_programstatus.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: SQL error message after logging into new installation
Ok, that's positive...
Now
Now
Code: Select all
echo "USE nagios;select instance_id, status_update_time,program_start_time,is_currently_running from nagios_programstatus" |mysql -pnagiosxiRe: SQL error message after logging into new installation
Here is the result of the command:
[root@mynagios ~]# echo "USE nagios;select instance_id,status_update_time,program_start_time,is_currently_running from nagios_programstatus" | mysql -pnagiosxi
ERROR 130 (HY000) at line 1: Incorrect file format 'nagios_programstatus'
[root@mynagios ~]# echo "USE nagios;select instance_id,status_update_time,program_start_time,is_currently_running from nagios_programstatus" | mysql -pnagiosxi
ERROR 130 (HY000) at line 1: Incorrect file format 'nagios_programstatus'
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: SQL error message after logging into new installation
Please run
Code: Select all
mysqlcheck --auto-repair -A -pnagiosxiRe: SQL error message after logging into new installation
Just a note on this, it needs to be in on the <table_name>.MYI file. So for this circumstance it would need to be:[root@mynagios nagios]# myisamchk -r -f nagios_programstatus
myisamchk: error: 'nagios_programstatus' is not a MyISAM-table
Code: Select all
myisamchk -r -f nagios_programstatus.MYIRe: SQL error message after logging into new installation
@mguthrie
Adding the extension you mentioned did not work. Here is the result:
[root@mynagios nagios]# myisamchk -r -f nagios_programstatus.MYI
myisamchk: error: 'nagios_programstatus.MYI' is not a MyISAM-table
Adding the extension you mentioned did not work. Here is the result:
[root@mynagios nagios]# myisamchk -r -f nagios_programstatus.MYI
myisamchk: error: 'nagios_programstatus.MYI' is not a MyISAM-table