Modifying backup_xi.sh for offloaded DB
Posted: Fri Jan 03, 2014 1:36 pm
Currently, the backup_xi.sh script performs the following for local MySQL DB backup:
The doc on offloading mysql http://assets.nagios.com/downloads/nagi ... Server.pdf doesn't make any reference on what to do for backups when you move the DB.
I want to limit the accounts I have accessing the DB remotely, so can I not just modify the script to use the nagios/nagiosql accounts and add the '-h <db IP>' option to the above commands?
The next problem would be that any new upgrade to XI would potentially overwrite the scripts, as you guys make changes. Any chance you can accommodate for offloaded MySQL in official scripts? Or should I just stick with running my own modified version?
Thanks,
Andrew
Code: Select all
echo "Backing up MySQL databases..."
mkdir -p $mydir/mysql
mysqldump -u root --password=$mysqlpass --add-drop-database -B nagios > $mydir/mysql/nagios.sql
res=$?
if [ $res != 0 ]; then
echo "Error backing up MySQL database 'nagios' - check the password in this script!"
exit;
fi
mysqldump -u root --password=$mysqlpass --add-drop-database -B nagiosql > $mydir/mysql/nagiosql.sql
res=$?
if [ $res != 0 ]; then
echo "Error backing up MySQL database 'nagiosql' - check the password in this script!"
exit;
fi
I want to limit the accounts I have accessing the DB remotely, so can I not just modify the script to use the nagios/nagiosql accounts and add the '-h <db IP>' option to the above commands?
The next problem would be that any new upgrade to XI would potentially overwrite the scripts, as you guys make changes. Any chance you can accommodate for offloaded MySQL in official scripts? Or should I just stick with running my own modified version?
Thanks,
Andrew