Manage Users page SQL error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
TBT
Posts: 625
Joined: Wed May 18, 2011 1:26 pm

Manage Users page SQL error

Post 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...
Nagios XI 2024R2.2.1 (8 Servers)
Nagios Fusion 2024R1.0.2
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Manage Users page SQL error

Post 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.
TBT
Posts: 625
Joined: Wed May 18, 2011 1:26 pm

Re: Manage Users page SQL error

Post by TBT »

Does the suggest repair_database script account for remote DB's?
Nagios XI 2024R2.2.1 (8 Servers)
Nagios Fusion 2024R1.0.2
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Manage Users page SQL error

Post 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.
Previous Nagios employee
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Manage Users page SQL error

Post 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.
TBT
Posts: 625
Joined: Wed May 18, 2011 1:26 pm

Re: Manage Users page SQL error

Post by TBT »

dwhitfield wrote: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.
As you can see, we identified this quite sometime ago. Would be wonderful if it gets resolved ASAP.
Nagios XI 2024R2.2.1 (8 Servers)
Nagios Fusion 2024R1.0.2
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Manage Users page SQL error

Post 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.
Previous Nagios employee
TBT
Posts: 625
Joined: Wed May 18, 2011 1:26 pm

Re: Manage Users page SQL error

Post 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.
Nagios XI 2024R2.2.1 (8 Servers)
Nagios Fusion 2024R1.0.2
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Manage Users page SQL error

Post 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
Former Nagios Employee
TBT
Posts: 625
Joined: Wed May 18, 2011 1:26 pm

Re: Manage Users page SQL error

Post 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.
Nagios XI 2024R2.2.1 (8 Servers)
Nagios Fusion 2024R1.0.2
Locked