Page 1 of 1

NagiosXI - Database Error

Posted: Wed Apr 03, 2019 7:45 am
by Pselvin
Hi Team,

NagiosXI is throwing Database Error message. (OS - RHEL 7)
Database Error
A database connection error has been detected, please follow the repair prompt below. If the issue persists, please contact Nagios support. 
Run the following from the CLI as root to attempt to repair the DB:
/usr/local/nagiosxi/scripts/repair_databases.sh
These are the steps that we have followed to fix this error but, this issue is still exist. Kindly assist.
(Please note that i am unable to find the NagiosXI version as, GUI is down. Kindly share the command to find the same)

1. /Var was full and we ran the below command to fix this space issue. (This freed up the good amount of space)
echo "truncate table xi_events; truncate table xi_meta; truncate table xi_eventqueue;" | mysql -u root -pnagiosxi nagiosxi

2. Ran the following command to repair the database

Code: Select all

[root@losatlngs01 mysql]# /usr/local/nagiosxi/scripts/repair_databases.sh
DATABASE: nagios
TABLE:
/var/lib/mysql/nagios /var/lib/mysql
- recovering (with sort) MyISAM-table 'nagios_acknowledgements' 

**********************

- recovering (with sort) MyISAM-table 'xi_users'
Data records: 55
- Fixing index 1
- Fixing index 2
Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.
/var/lib/mysql

===============
REPAIR COMPLETE
===============

=======================
nagios database repair succeeded
nagiosql database repair succeeded
nagiosxi database repair succeeded

[root@losatlngs01 mysql]#  
 

Re: NagiosXI - Database Error

Posted: Wed Apr 03, 2019 10:15 am
by benjaminsmith
Hi @Pselvin,
Job for mariadb.service failed because the control process exited with error code
It looks like mariadb is unable to start. Please post the database log file for us to review.

Code: Select all

tail /var/log/mariadb/mariadb.log
Next, try re-starting the Nagios stack and let us know if your able to login into the GUI.

Code: Select all

systemctl stop crond
systemctl stop npcd
systemctl stop nagios
systemctl stop ndo2db
pkill -9 -u nagios
for i in $(ipcs -q | grep nagios |awk '{print $2}'); do ipcrm -q $i; done
rm -rf /usr/local/nagiosxi/var/dbmaint.lock
rm -rf /usr/local/nagiosxi/var/event_handler.lock
rm -rf /usr/local/nagiosxi/scripts/reconfigure_nagios.lock
systemctl restart mariadb
systemctl start ndo2db
systemctl start nagios
systemctl start npcd
systemctl start crond

Re: NagiosXI - Database Error

Posted: Thu Apr 04, 2019 1:49 am
by Pselvin
Thank you. I have rebooted the entire server and the DB is fully UP. Thanks for your time. Please close this case.