Page 2 of 2

Re: Nagios is not able to be logged in from GUI

Posted: Tue Mar 22, 2016 4:05 pm
by amit.ahuja
One more finding here. In the mysqld.log file, I also found 30k+ lines of errors.
Some look like below.

Code: Select all

160321 17:47:22 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './nagios/nagios_servicestatus.MYI'; try to repair it
160321 17:47:22 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './nagios/nagios_servicestatus.MYI'; try to repair it
160321 17:47:22 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './nagios/nagios_servicestatus.MYI'; try to repair it
160321 17:47:46 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './nagios/nagios_servicestatus.MYI'; try to repair it
160321 17:47:46 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './nagios/nagios_servicestatus.MYI'; try to repair it
160321 17:48:16 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './nagios/nagios_hoststatus.MYI'; try to repair it
160321 17:48:16 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './nagios/nagios_hoststatus.MYI'; try to repair it
160321 17:48:16 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './nagios/nagios_hoststatus.MYI'; try to repair it
160321 17:48:16 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './nagios/nagios_hoststatus.MYI'; try to repair it
160321 17:48:20 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './nagios/nagios_servicestatus.MYI'; try to repair it
160321 17:48:20 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './nagios/nagios_servicestatus.MYI'; try to repair it
160321 17:48:20 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './nagios/nagios_servicestatus.MYI'; try to repair it
160321 17:48:20 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './nagios/nagios_servicestatus.MYI'; try to repair it
160321 17:48:46 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './nagios/nagios_hoststatus.MYI'; try to repair it
160321 17:48:46 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './nagios/nagios_hoststatus.MYI'; try to repair it
160321 17:48:46 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './nagios/nagios_hoststatus.MYI'; try to repair it
160321 17:48:46 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './nagios/nagios_hoststatus.MYI'; try to repair it
160321 17:48:46 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './nagios/nagios_servicestatus.MYI'; try to repair it
160321 17:48:46 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './nagios/nagios_servicestatus.MYI'; try to repair it
160321 17:48:46 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './nagios/nagios_servicestatus.MYI'; try to repair it
160321 17:48:46 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './nagios/nagios_servicestatus.MYI'; try to repair it
160321 17:48:46 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './nagios/nagios_servicestatus.MYI'; try to repair it
160321 17:48:46 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './nagios/nagios_servicestatus.MYI'; try to repair it
Permission and user are correct as I compared with other servers.

Re: Nagios is not able to be logged in from GUI

Posted: Tue Mar 22, 2016 4:25 pm
by lmiltchev
You can try repairing the database by running:

Code: Select all

mysqlcheck -r -f -u root -pnagiosxi --databases nagios
or

Code: Select all

service mysqld stop
cd /var/lib/mysql/nagios
myisamchk -r -f *
service mysqld start
rm -f /usr/local/nagiosxi/var/dbmaint.lock
/usr/bin/php /usr/local/nagiosxi/cron/dbmaint.php
If this doesn't work, and you still see the "Incorrect key file for table..." error in the mysqld.log, try:

Code: Select all

echo 'repair table <broken table> use_frm;' | mysql -t -u root -pnagiosxi nagios
where you substitute <broken table> with the actual table name.

Re: Nagios is not able to be logged in from GUI

Posted: Wed Mar 23, 2016 8:24 am
by amit.ahuja
Hi, i used the commands to repair the database. I didn't see the "Incorrect key file for table..." error in the mysqld.log anymore in recent lines. However, Nagiosxi still cannot be logged in.

Re: Nagios is not able to be logged in from GUI

Posted: Wed Mar 23, 2016 11:22 am
by lmiltchev
Run the following commands and show the output:

Code: Select all

service mysqld restart
service mysqld status
service postgresql restart
service postgresql status
service ndo2db restart
service ndo2db status
service nagios restart
service nagios  status
service httpd restart
sestatus
iptables -L -n | grep 80
service httpd status
What do you see when you try to log in the web interface? Can you show us a screenshot of the error that you are getting?

Re: Nagios is not able to be logged in from GUI

Posted: Wed Mar 23, 2016 12:43 pm
by amit.ahuja
Hi, lmiltchev. Thank you very much for your help. The issue was fixed. The problem is that the ownership of some directories and files in /var/. I compared the ownership of those files with another running nagios, and changed them, and now nagiosxi web interface is running properly. :D

Re: Nagios is not able to be logged in from GUI

Posted: Wed Mar 23, 2016 1:30 pm
by lmiltchev
Great! I am glad your issue has been resolved! :)