Page 1 of 3
Manage Users page SQL error
Posted: Thu Dec 08, 2016 11:57 am
by TBT
Noticed the following error printed at top of the Manage Users page on our Dev XI server. Please advise.
SQL Error [nagiosxi] : ERROR: column "login_attempts" does not exist
LINE 1: SELECT user_id FROM xi_users WHERE (login_attempts >= 3) AN...
Re: Manage Users page SQL error
Posted: Thu Dec 08, 2016 12:11 pm
by dwhitfield
First, try the following:
Code: Select all
cd /usr/local/nagiosxi/scripts/
./repair_databases.sh
If that doesn't do it, move to
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
php /usr/local/nagiosxi/cron/dbmaint.ph
There are more suggestions at
https://support.nagios.com/kb/article.php?id=24, but since this is a dev server, I wonder if it just makes sense to revert to snapshot.
If you want us to dig a bit more, can you PM me your Profile from the dev server? You can download it by going to Admin > System Config > System Profile and click the Download Profile (not Show Profile) button in the top right corner. If for whatever reason you cannot download the profile, please put the output of Show Profile in the thread (that will at least get us some info).
After you PM the profile, please update this thread. Updating this thread is the only way for it to show back up on our dashboard.
I know you had some problems PMing profiles in the past, though I can't remember the details. Email will work again if need-be.
Re: Manage Users page SQL error
Posted: Thu Dec 08, 2016 2:16 pm
by TBT
Does the suggest repair_database script account for remote DB's?
Re: Manage Users page SQL error
Posted: Thu Dec 08, 2016 2:43 pm
by avandemore
No it does not. You would either have to modify the scripts as appropriate to your configuration or manually run /usr/bin/myisamchk -r -f <other stuff> on your db host.
Re: Manage Users page SQL error
Posted: Thu Dec 08, 2016 2:51 pm
by dwhitfield
FWIW, the bug report # mentioned in
https://support.nagios.com/forum/viewto ... 16&t=34202 is incorrect. It's actually 6270...I'll fix it in the original thread.
Re: Manage Users page SQL error
Posted: Thu Dec 08, 2016 2:54 pm
by TBT
As you can see, we identified this quite sometime ago. Would be wonderful if it gets resolved ASAP.
Re: Manage Users page SQL error
Posted: Thu Dec 08, 2016 3:32 pm
by avandemore
Feature Requests are prioritized internally by the development team. If you want a higher priority, custom development is available for a fee. Please contact
[email protected] if you are interested.
Re: Manage Users page SQL error
Posted: Fri Dec 09, 2016 10:22 am
by TBT
avandemore wrote:Feature Requests are prioritized internally by the development team. If you want a higher priority, custom development is available for a fee. Please contact
[email protected] if you are interested.
This isn't a feature request. Your official Nagios documentation outlines remote Database support, but your recommendation (repair_databases.sh) still fails to take this into account. If your script accepted parameters, this would be a more viable support solution.
Re: Manage Users page SQL error
Posted: Fri Dec 09, 2016 11:39 am
by rkennedy
Following this thread I did a few things. First off, I spoke with our developers about this, and they do agree that the script can be updated for supporting offloaded databases. Since the current script uses local files to repair them, this would require re-writing it though. I have brought the feature request back to their attention though so it should be addressed in a future feature release.
Secondly, @avandemore has filed something a request internally here for our documentation to be updated, to take the offloaded DB's into account so that this information is readily available.
On a side note, you should be able to run the following commands from the local machine, against the offloaded db (adjust as needed) -
Code: Select all
mysqlcheck -f -r -u nagiosxi -pnagios --databases nagiosxi -h xxx.xxx.xxx.xxx
mysqlcheck -f -r -u nagios -pnagios --databases nagios -h xxx.xxx.xxx.xxx
mysqlcheck -f -r -u nagiosql -pnagios --databases nagiosql -h xxx.xxx.xxx.xxx
Re: Manage Users page SQL error
Posted: Fri Dec 09, 2016 12:05 pm
by TBT
rkennedy wrote:Following this thread I did a few things. First off, I spoke with our developers about this, and they do agree that the script can be updated for supporting offloaded databases. Since the current script uses local files to repair them, this would require re-writing it though. I have brought the feature request back to their attention though so it should be addressed in a future feature release.
Secondly, @avandemore has filed something a request internally here for our documentation to be updated, to take the offloaded DB's into account so that this information is readily available.
On a side note, you should be able to run the following commands from the local machine, against the offloaded db (adjust as needed) -
Code: Select all
mysqlcheck -f -r -u nagiosxi -pnagios --databases nagiosxi -h xxx.xxx.xxx.xxx
mysqlcheck -f -r -u nagios -pnagios --databases nagios -h xxx.xxx.xxx.xxx
mysqlcheck -f -r -u nagiosql -pnagios --databases nagiosql -h xxx.xxx.xxx.xxx
Thank you for the informative post. We will try the suggestion and report back.