Page 1 of 1

issue with database

Posted: Wed Aug 31, 2016 1:17 pm
by abhi
Hi There!
Im pretty new to nagios and I am running into this issue everytime I try to login to the webpage.
Request you to kindly advise me on how to troubleshoot the same.
Thank you,
A

Re: issue with database

Posted: Wed Aug 31, 2016 2:15 pm
by mcapra
Have you tried running the script mentioned on that page from the CLI?

Code: Select all

/usr/local/nagiosxi/scripts/repair_databases.sh

Re: issue with database

Posted: Wed Aug 31, 2016 3:26 pm
by abhi
Hi there,
Yes I did run the script .. but it didnt work and I am encountering the same issue. Please let me know what is the best way to resolve it.
Thank you

Re: issue with database

Posted: Wed Aug 31, 2016 3:27 pm
by mcapra
Can you share the output of that script? Also share the output of the following:

Code: Select all

ls -al /usr/local/nagiosxi/scripts/

Re: issue with database

Posted: Wed Aug 31, 2016 3:37 pm
by abhi
Hi there
here is the screenshot for : ls -al /usr/local/nagiosxi/scripts/
Please let me know how to proceed.
Than you

Re: issue with database

Posted: Wed Aug 31, 2016 3:39 pm
by mcapra
Please remove the repair_databases.lock file and run the script again:

Code: Select all

rm /usr/local/nagiosxi/scripts/repair_databases.lock
/usr/local/nagiosxi/scripts/repair_databases.sh

Re: issue with database

Posted: Wed Aug 31, 2016 3:58 pm
by abhi
Hi There,
So I ran the commands you asked me to run but ran into the following issue.
Please let me know how I can proceed next.
Thank you

Re: issue with database

Posted: Wed Aug 31, 2016 4:32 pm
by mcapra
Strange that there are no myi files in that directory. Share the output of:

Code: Select all

ls -al /var/lib/mysql/nagios
ls -al /var/lib/mysql/nagiosql
ls -al /var/lib/mysql/nagiosxi

Re: issue with database

Posted: Wed Aug 31, 2016 4:42 pm
by abhi
Hi there,
I ran the commands as instructed by you, here is the output of it..please let me know the next best step,
Thank you

[root@nagios ~]# ls -al /var/lib/mysql/nagios
total 8
drwxr-xr-x 2 root root 4096 Mar 17 15:29 .
drwxr-xr-x. 4 mysql mysql 4096 Aug 31 14:36 ..

[root@nagios ~]# ls -al /var/lib/mysql/nagiosql
total 8
drwxr-xr-x 2 root root 4096 Mar 17 15:32 .
drwxr-xr-x. 4 mysql mysql 4096 Aug 31 14:39 ..

[root@nagios ~]# ls -al /var/lib/mysql/nagiosxi
ls: cannot access /var/lib/mysql/nagiosxi: No such file or directory

Re: issue with database

Posted: Wed Aug 31, 2016 4:45 pm
by mcapra
It looks like you're missing some important files for your MySQL databases.

Please follow this KB article for instructions on how to restore them from a backup:
https://support.nagios.com/kb/article.php?id=492

If you don't know of any backups in existence, you might refer to the "Emergency Restore" section.