NagiosXI - Database Error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Pselvin
Posts: 51
Joined: Tue Dec 13, 2016 1:28 pm

NagiosXI - Database Error

Post 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]#  
 
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: NagiosXI - Database Error

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Pselvin
Posts: 51
Joined: Tue Dec 13, 2016 1:28 pm

Re: NagiosXI - Database Error

Post by Pselvin »

Thank you. I have rebooted the entire server and the DB is fully UP. Thanks for your time. Please close this case.
Locked