Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Bash script to install MySQL Enterprise Monitor Service Manager 3.x in Enterprise Linux 7.x
#!/bin/bash
#Bash script to install MySQL Enterprise Monitor Service Manager 3.x in Enterprise Linux 7.x
#Copy the MEM executable binary (mysqlmonitor*.bin) into the $PACKAGES_DIR and run this script as root
#You can find the binaries in http://support.oracle.com (preferable) or http://edelivery.oracle.com
#Modify these variables as you wish
DIR_TO_INSTALL=/opt/mysql/enterprise/monitor
PACKAGES_DIR=/home/vagrant/packages #This folder already contains the Executable Binaries
MEM_SERVICE_PORT=18443
REPO_HOST=127.0.0.1
REPO_PORT=13306
REPO_USR=service_manager
REPO_PWD=secret
set -e # stop script execution on any error
mkdir -p $DIR_TO_INSTALL
#Next lines install MySQL Enterprise Monitor Agent
MEM_INSTALLER=$(ls -d $PACKAGES_DIR/mysqlmonitor-3* | head -1)
echo "Installing MEM Service Manager..."
$MEM_INSTALLER --mode unattended \
--installdir $DIR_TO_INSTALL \
--system_size small \
--mysql_installation_type bundled \
--adminuser $REPO_USR \
--adminpassword $REPO_PWD
echo "MySQL MEM Service Manager installed in $DIR_TO_INSTALL"
$DIR_TO_INSTALL/mysqlmonitorctl.sh status
echo "Granting privileges for remote administration of MySQL MEM Service Manager repository..."
$DIR_TO_INSTALL/mysql/bin/mysql -u"$REPO_USR" -p"$REPO_PWD" -h$REPO_HOST -P$REPO_PORT -e " \
CREATE USER IF NOT EXISTS '$REPO_USR'@'%' IDENTIFIED BY '$REPO_PWD'; \
GRANT ALL PRIVILEGES ON *.* TO '$REPO_USR'@'%' WITH GRANT OPTION;"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment