# DCmysq.cfg: Collects Oracle MySQL Server Information # $Id: DCmysq.cfg,v 1.8 2015/09/25 00:13:10 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/DB/DCmysq.cfg,v 1.8 2015/09/25 00:13:10 RDA Exp $ # # Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. # # Change history # 20150924 MSC Eliminate trailing spaces. ############################################################################### # Collect Oracle MySQL Server setup information ############################################################################### #------------------------------------------------------------------------------ # Module definition #------------------------------------------------------------------------------ col=${B_IN_USE} dsc='Collects Oracle MySQL Server Information' fam=Cygwin,Unix,Windows pre=RDA:DCbegin rpt=B_IN_USE var=not_used # Flow:in_use,B_IN_USE exe=sdcl { "var @{AUX.var} = cond(${AUX.N_DEPTH},list(),\ " ${PRF.B_TESTS},list('in_use'),\ " list('B_IN_USE')) " "macro check_protocol "{var ($typ) = @arg " " if or(${RDA.B_CYGWIN},${RDA.B_WINDOWS}) " require match($typ,'^(MEMORY|PIPE|TCP)$'),\ " 'Error: Supported MEMORY, PIPE, or TCP' " else " require match($typ,'^(SOCKET|TCP)$'),\ " 'Error: Supported SOCKET or TCP' "} } #------------------------------------------------------------------------------ # Setting definitions #------------------------------------------------------------------------------ [in_use] typ=B dft=true dsc='Is Oracle MySQL Server information requested?' nam=B_IN_USE var=F_CONFIG,D_HOME,D_DATA,get_instance,W_PROTOCOL,T_USER,\ N_LOOP,N_SLEEP,N_TAIL [not_used] typ=B dft=false dsc='Is Oracle MySQL Server information requested?' nam=B_IN_USE [B_IN_USE] typ=B dft=${AUX.B_SELECTED} dsc='Is Oracle MySQL Server information requested?' inp='Do you want RDA to collect Oracle MySQL Server information (Y/N)?' var=true:F_CONFIG,D_HOME,D_DATA,get_instance,W_PROTOCOL,T_USER,\ N_LOOP,N_SLEEP,N_TAIL [F_CONFIG] typ=F dsc='Oracle MySQL Server configuration file' err='Warning: The specified file does not -yet- exist' fmt='< $top (${ENV.PROGRAMFILES},\ " ${ENV.ProgramFiles(x86)},\ " ${ENV.ProgramW6432}) " {next exists($dup{$top}) " var $dup{$top} " loop $pth (findDir(catDir($top,'MySQL'),'^MySQL Server','p')) " {if ?testFile('fr',catFile($pth,'bin',${AS.EXE:'mysql'})) " {var $dir = $pth " break " } " } " } "} "if length($dir) " var (${AUX.dft},${AUX.lvl}) = ($dir,6) } #------------------------------------------------------------------------------ # Identify the MySQL data directory #------------------------------------------------------------------------------ [D_DATA] typ=D dsc='Oracle MySQL Server data directory' err='Warning: The specified directory does not -yet- exist' inp='Enter the full path of the Oracle MySQL Server data directory' val=W exe=sdcl { "var $dir = '' "if grepFile(${F_CONFIG},'^[^\043]*\bdatadir\s*=\s*(\042)?(.*)?\1','f2') " var ($dir) = last "elsif isUnix() "{if ?testDir('d','/var/lib/mysql') " var $dir = '/var/lib/mysql' "} "elsif or(isWindows(),isCygwin()) "{if ?testDir('d',catDir(${D_HOME},'data')) " var $dir = lastDir() " else " {loop $top (catDir(${ENV.ALLUSERSPROFILE},'Application Data','MySQL'),\ " catDir(${ENV.APPDATA},'MySQL')) " {loop $pth (findDir($top,'^MySQL Server','p')) " {if ?testDir('d',catDir($pth,'Data')) " {var $dir = lastDir() " break " } " } " } " } "} "if length($dir) " var (${AUX.dft},${AUX.lvl}) = ($dir,6) } #------------------------------------------------------------------------------ # Select the database server instance #------------------------------------------------------------------------------ [get_instance] typ=M ask=0 bef='Oracle MySQL Server instance list:' dsc='Database server instance' err='Enter a menu item number only' inp='Enter the number corresponding to the server instance name' mnu='<