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