Restore of database - Database error
Restore of database - Database error
Hi
I'm moving Nagiosxi to a new CentOS7 Server
I have migrated 6 systems so far and all have went well apart from this last one
I install Nagiosxi 5.6.14
I access the URL and all looks fine I can login with the nagiosadmin user as its the default database there is no hosts
I restore from a backup I took this morning backup is approx 5.7GB
I run the tarball as we are moving from RHEL6 to CentOS7
when the tarball is complete I just get the error
Database Error
Screen shot attached
I run the command
/usr/local/nagiosxi/scripts/repair_database.sh
seems to complete without issues
only this is when its complete it only lists 2 database does not mention the nagiosxi database
Screenshot attached
So I tried to run the repairmysql.sh nagiosxi but nothing happens
Screenshot attached
I'm moving Nagiosxi to a new CentOS7 Server
I have migrated 6 systems so far and all have went well apart from this last one
I install Nagiosxi 5.6.14
I access the URL and all looks fine I can login with the nagiosadmin user as its the default database there is no hosts
I restore from a backup I took this morning backup is approx 5.7GB
I run the tarball as we are moving from RHEL6 to CentOS7
when the tarball is complete I just get the error
Database Error
Screen shot attached
I run the command
/usr/local/nagiosxi/scripts/repair_database.sh
seems to complete without issues
only this is when its complete it only lists 2 database does not mention the nagiosxi database
Screenshot attached
So I tried to run the repairmysql.sh nagiosxi but nothing happens
Screenshot attached
You do not have the required permissions to view the files attached to this post.
Re: Restore of database - Database error
Was your "old" system using postgres? Maybe nagiosxi db is there. What is the output of the command below?
Code: Select all
echo '\d' | psql nagiosxi nagiosxiBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: Restore of database - Database error
Hi Here are the screenshots from the provided command on both Nagios system
Current and New
Current and New
You do not have the required permissions to view the files attached to this post.
Re: Restore of database - Database error
OK, so I was correct about postgres being used on your old system. This shouldn't be a problem though. Are you still seeing db errors? What is the actual issue that you are currently having?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Restore of database - Database error
Hi
When I start the server (it is currently off at the moment and the original server is still running RHEL6)
All I get is the Database Error shown in the screenshot
and when I try and repair the database nothing happens it says Repair Complete but all I see if that message no login screen nothing just that message
Thanks
When I start the server (it is currently off at the moment and the original server is still running RHEL6)
All I get is the Database Error shown in the screenshot
and when I try and repair the database nothing happens it says Repair Complete but all I see if that message no login screen nothing just that message
Thanks
Re: Restore of database - Database error
Is postgreql running on the new server? Run the following commands, and show the output:
Also, you are changing the OS version, so I wonder - have you tried running the "restore_repair.sh" script as described on page 13 in the document below?
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
If you haven't, try running it to see if this is going to fix your issue.
Code: Select all
service postgresql restart
service postgresql statushttps://assets.nagios.com/downloads/nag ... ios-XI.pdf
If you haven't, try running it to see if this is going to fix your issue.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Restore of database - Database error
Hi
I had run the restore_repair.sh script
But this morning what I did was removed Nagiosxi and did a complete new install and then tested another Database restore
I got the same issue, so I am working if this is a corrupted backup
I will see if i can run another backup and run the restore with the new backup
I have attached a screenshot of the postgresql status
I have attached a copy of the restore text
I found the following which is very similar to the issue I am seeing
https://support.nagios.com/forum/viewto ... 6&start=10
Commands
echo "vacuum;vacuum analyse;vacuum full;"|psql nagiosxi postgres
echo "vacuum;vacuum analyse;vacuum full;"|psql postgres postgres
echo "vacuum;vacuum analyse;vacuum full;"|psql template1 postgres
Output
echo "vacuum;vacuum analyse;vacuum full;"|psql nagiosxi postgres
VACUUM
VACUUM
VACUUM
echo "vacuum;vacuum analyse;vacuum full;"|psql postgres postgres
VACUUM
VACUUM
VACUUM
echo "vacuum;vacuum analyse;vacuum full;"|psql template1 postgres
VACUUM
VACUUM
VACUUM
I had run the restore_repair.sh script
But this morning what I did was removed Nagiosxi and did a complete new install and then tested another Database restore
I got the same issue, so I am working if this is a corrupted backup
I will see if i can run another backup and run the restore with the new backup
I have attached a screenshot of the postgresql status
I have attached a copy of the restore text
I found the following which is very similar to the issue I am seeing
https://support.nagios.com/forum/viewto ... 6&start=10
Commands
echo "vacuum;vacuum analyse;vacuum full;"|psql nagiosxi postgres
echo "vacuum;vacuum analyse;vacuum full;"|psql postgres postgres
echo "vacuum;vacuum analyse;vacuum full;"|psql template1 postgres
Output
echo "vacuum;vacuum analyse;vacuum full;"|psql nagiosxi postgres
VACUUM
VACUUM
VACUUM
echo "vacuum;vacuum analyse;vacuum full;"|psql postgres postgres
VACUUM
VACUUM
VACUUM
echo "vacuum;vacuum analyse;vacuum full;"|psql template1 postgres
VACUUM
VACUUM
VACUUM
You do not have the required permissions to view the files attached to this post.
Re: Restore of database - Database error
How much space do you have on the new server?
Have you checked both logs (postgres and mysql) for errors?
The postgres logs should be located in the "/var/lib/pgsql/data/pg_log" directory. You can use tail to view the most recent log, e.g.:
For mysql logs, you could run this:
or this:
depending on whether you are using mysql or mariadb.
Code: Select all
df -hThe postgres logs should be located in the "/var/lib/pgsql/data/pg_log" directory. You can use tail to view the most recent log, e.g.:
Code: Select all
tail -100 /var/lib/pgsql/data/pg_log/postgresql-Wed.logCode: Select all
tail -100 /var/log/mysqld.logCode: Select all
tail -100 /var/log/mariadb/mariadb.logBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: Restore of database - Database error
Hi
Find attached the output from the above commands
Can you take a look and see if anything stands out to you
Thanks
Find attached the output from the above commands
Can you take a look and see if anything stands out to you
Thanks
You do not have the required permissions to view the files attached to this post.
Re: Restore of database - Database error
When you run the repair on the db (mysql), according to your screenshot:
nagiosxi db is not present in mysql. Only nagios and nagiosql databases are repaired. Since you are restoring from an old system, nagiosxi db must be in postgres. But looking at your postgres log, I see this:
Are you sure your backup is not corrupted? Can you find the nagiosxi db in the backup tarball? Is it in postgres or mysql?FATAL: database "nagiosxi" does not exist
You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!