I am currently working on migrating from a CentOS 6 server to a new CentOS 7. When I run the restore_
xi.sh script on the new server, get the error "/usr/local/nagios
xi/scripts/restore_
xi.sh: line 388: DROP TABLE IF E
xiSTS nagios
xi;: No such file or directory", due to an incorrect line in the script. This only matters if you're using a postgresql database, which we are. The offending line reads:
mysql -h "$nagiosql_dbserver" --port="$nagiosql_dbport" -u root --password=$mysqlpass < "DROP TABLE IF ExiSTS nagiosxi;" which is looking for a file named "DROP TABLE IF E
xiSTS nagios
xi;" (and incorrectly references table nagios
xi instead of database nagios
xi). The line should read
Code: Select all
mysql -h "$nagiosql_dbserver" --port="$nagiosql_dbport" -u root --password=$mysqlpass <<< "DROP DATABASE IF ExiSTS nagiosxi;"
or
Code: Select all
echo "DROP DATABASE IF ExiSTS nagiosxi;" | mysql -h "$nagiosql_dbserver" --port="$nagiosql_dbport" -u root --password=$mysqlpass
The backup restored correctly other than that, but it did cause some confusion when attempting to migrate the postgresql DB over to mariadb, since the nagios
xi database wasn't deleted properly during the restore. Just wanted to make sure the team was aware