Create a gist now

Instantly share code, notes, and snippets.

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
USER_REPO=service_manager
PASSWORD_REPO=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 $USER_REPO \
--adminpassword $PASSWORD_REPO
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"$USER_REPO" -p"$PASSWORD_REPO" -h127.0.0.1 -P13306 -e " \
CREATE USER '$USER_REPO'@'%' IDENTIFIED BY '$PASSWORD_REPO'; \
GRANT ALL PRIVILEGES ON *.* TO '$USER_REPO'@'%' WITH GRANT OPTION;"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment