Page 1 of 1
Database got corrupt , Once repaired , asking install
Posted: Mon Dec 16, 2019 2:52 pm
by biswajit.banerjee
Hi
I was running Nagios Xi for few years
Had Database Corruption , After repair (screenshot attached ) the Nagios Xi web Page asking for install .Please see the Attached screenshot
What can be the Issue and how can I get it fixed
Re: Database got corrupt , Once repaired , asking install
Posted: Mon Dec 16, 2019 5:01 pm
by tgriep
The table that holds the server activation may still be corrupted so follow this process to stop everything, clean the temporary data and start up the processes.
Run all of it as root. Adjust the MYSQL password as needed.
Code: Select all
service npcd stop
service nagios stop
service ndo2db stop
service crond stop
pkill -9 -u nagios
echo "truncate table xi_events; truncate table xi_meta; truncate table xi_eventqueue;" | mysql -u root -pnagiosxi nagiosxi
mysqlcheck -f -r -u root -pnagiosxi --all-databases --use-frm
if grep --quiet pgsql /usr/local/nagiosxi/html/config.inc.php; then service postgresql stop; fi;
service mysqld restart
rm -f /usr/local/nagios/var/rw/nagios.cmd
rm -f /usr/local/nagios/var/nagios.lock
rm -f /var/run/nagios.lock
rm -f /usr/local/nagios/var/ndo.sock
rm -f /usr/local/nagios/var/ndo2db.lock
rm -f /var/lib/mrtg/mrtg_l
rm -f /usr/local/nagiosxi/var/*.lock
for i in `ipcs -q | grep nagios |awk '{print $2}'`; do ipcrm -q $i; done
pkill python
if grep --quiet pgsql /usr/local/nagiosxi/html/config.inc.php; then service postgresql start; fi;
service httpd restart
service ndo2db start
service nagios start
service npcd start
service crond start
Let the system run for 5 minutes and then login to the XI GUI to see if it still wants you to finish the installation.
Re: Database got corrupt , Once repaired , asking install
Posted: Mon Dec 16, 2019 8:00 pm
by biswajit.banerjee
After Attempting the mentioned steps , The Nagios Xi GUI Is still prompting for install
Please let me know the Further Steps to diagnose and Resolve .
Re: Database got corrupt , Once repaired , asking install
Posted: Tue Dec 17, 2019 10:05 am
by tgriep
At this point, you have 2 options, it you have access to a backup from before the corruption, you can restore to that is hopefully is will have all of the required settings.
Or, finish the installation of the server so you can login to it and check all of the settings and re-setup the server if needed.
Re: Database got corrupt , Once repaired , asking install
Posted: Tue Dec 17, 2019 1:40 pm
by biswajit.banerjee
I could Restore the Xi_option table and proceed . I could Login now but in CCM the hosts and services are missing as attached
Can you please guide .
Re: Database got corrupt , Once repaired , asking install
Posted: Tue Dec 17, 2019 2:53 pm
by tgriep
Go in to the Core Config Manager > Configuration Snapshots menu and if there is a snapshot available from before the corruption, restore the configs using that.
Else, in a backup file is the nagiosql.sql database file, you can use that to restore the database that holds the configurations for the CCM which you can use to restore.
Extract a backup file and in the extracted folder is a mysql folders. In there is th nagiosql.sql file you can use to restore the database.
Run this to restore the configurations from the extracted backups.
Code: Select all
mysql -u root -pnagiosxi <nagiosql.sql
Re: Database got corrupt , Once repaired , asking install
Posted: Tue Dec 17, 2019 7:15 pm
by biswajit.banerjee
Thanks for your Support .
We have restored the nagiosql database .
Thanks
Re: Database got corrupt , Once repaired , asking install
Posted: Wed Dec 18, 2019 7:30 am
by scottwilkerson
biswajit.banerjee wrote:Thanks for your Support .
We have restored the nagiosql database .
Thanks
Great!
Locking thread