SQL Error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mkeey
Posts: 199
Joined: Mon Sep 25, 2017 11:13 am

SQL Error

Post by mkeey »

When I go to the Home page and try any display I receive this on the screen...
SQL Error [ndoutils] : Incorrect file format 'nagios_servicestatus'

Went to Admin / System Status and I get a blank screen.

Tried to delete the ndo.sock and reboot server. No change.
Tried to delete all config files, write config files and restart core. No change.

There was a post regarding this but the customer was requested to open a service ticket and I couldn't see the resolution.

Nagios XI is inoperable at this time.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: SQL Error

Post by benjaminsmith »

Hi @mkeey,

Please run the database repair script, log into the server as root and run the following:

Code: Select all

/usr/local/nagiosxi/scripts/repair_databases.sh
If that doesn't resolve the error, run the following command:

Code: Select all

service mysqld start
echo 'repair table nagios_servicestatus use_frm;' | mysql -t -u root -pnagiosxi nagios
service mysqld restart
Let us know if you get it resolved.

Reference:
Repairing The Nagios XI Databases
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
mkeey
Posts: 199
Joined: Mon Sep 25, 2017 11:13 am

Re: SQL Error

Post by mkeey »

First command appears to have failed...

[root@NAGIOXISERVER]:[/root]# systemctl start mysqld
Failed to start mysqld.service: Unit not found.

Currently performing the second part of your instructions.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: SQL Error

Post by ssax »

Replace mysqld with mariadb in your commands:

Code: Select all

systemctl start mariadb
echo 'repair table nagios_servicestatus use_frm;' | mysql -t -u root -pnagiosxi nagios
systemctl restart mariadb
If it still fails to start, please send the output of this command:

Code: Select all

tail /var/log/messages /var/log/mariadb/mariadb.log
mkeey
Posts: 199
Joined: Mon Sep 25, 2017 11:13 am

Re: SQL Error

Post by mkeey »

Tried the first part and got this...
[root@NAGIOSXISERVER]:[/root]# echo 'repair table nagios_servicestatus use_frm;' | mysql -t -u root -pnagiosxi nagios
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Server has since crashed and we're trying to get it back up so the "tail" command hasn't been issued.
mkeey
Posts: 199
Joined: Mon Sep 25, 2017 11:13 am

Re: SQL Error

Post by mkeey »

Problem is resolved. Found we had to Stop the DB first and then run the Repair and then Start the DB.

1) systemctl stop mariadb
2) /usr/local/nagiosxi/scripts/repair_databases.sh
3) systemctl start mariadb

Please close the case as resolved.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: SQL Error

Post by benjaminsmith »

Hi @mkeey,
Problem is resolved. Found we had to Stop the DB first and then run the Repair and then Start the DB.
Good to hear you got it working again. We'll mark this thread as closed. If you have further issues, just start a new thread.

Thanks!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked