# DCwsp.cfg: Collects IBM WebSphere Application Server Information # $Id: DCwsp.cfg,v 1.10 2015/04/17 11:36:40 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/OFM/DCwsp.cfg,v 1.10 2015/04/17 11:36:40 RDA Exp $ # # Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. # # Change history # 20150417 KRA Added 'N_INCIDENT_FILES' and removed 'N_INCIDENTS' setting. ############################################################################### # Collect the IBM WebSphere Application Server setup information ############################################################################### #------------------------------------------------------------------------------ # Module definition #------------------------------------------------------------------------------ col=${B_IN_USE} dsc='Collects IBM WebSphere Application Server Information' pre=RDA:DCbegin rpt=B_IN_USE var=not_used # Flow:in_use,B_IN_USE exe=sdcl { "var @{AUX.var} = (cond(${PRF.B_TESTS},'in_use','B_IN_USE')) " "macro check_cell "{loop $prf (findDir($arg[0],'^[^\.]+$','np')) " {loop $cel (findDir(catDir($prf,'config','cells'),'^[^\.]+$','np')) " {if ?testFile('f',catFile($cel,'virtualhosts.xml')) " return 1 " } " } " return 0 "} " "macro is_valid_cell "{var ($nam,$dir) = @arg " require testDir('d',$dir),\ " 'The specified WebSphere Application Server profile root directory \ " does not exist.' " require isAbsolute($dir),\ " 'The specified WebSphere Application Server profile root directory \ " is not an absolute path.' " require check_cell($dir),\ " 'The specified WebSphere Application Server profile root directory \ " does not contain some IBM WebSphere Application Server related-files. \ " Without a valid directory, the collection will be disabled.' " var ${AUX.nam} = $nam " return true "} } #------------------------------------------------------------------------------ # Setting definitions #------------------------------------------------------------------------------ [in_use] typ=B dft=true dsc='Is IBM WebSphere Application Server information requested?' nam=B_IN_USE var=D_PROFILE_ROOT [not_used] typ=B dft=false dsc='Is IBM WebSphere Application Server information requested?' nam=B_IN_USE [B_IN_USE] typ=B dft=${AUX.B_SELECTED} dsc='Is IBM WebSphere Application Server information requested?' inp='Do you want RDA to analyze IBM WebSphere Application Server (Y/N)?' var=true:D_PROFILE_ROOT [D_PROFILE_ROOT] typ=D dsc='Profile root directory' fmt='<'Collect for a single server (offline mode)',\ ONE =>'Collect for a single server (using WAS connection)',\ MANY=>'Collect for multiple servers (using WAS connection)'] val=F var=OFF:T_CELLS,T_SERVERS,get_homes:\ ONE:T_CELLS,T_SERVERS,B_AUTH_AUTO,get_homes,N_INCIDENT_FILES:\ MANY:T_CELLS,T_SERVERS,B_AUTH_AUTO,get_homes,N_INCIDENT_FILES #------------------------------------------------------------------------------ # Select the cell(s) #------------------------------------------------------------------------------ [T_CELLS] typ=M ask=0 bef='Profile:Cell list:' dsc='Profile:Cell list' itm=[@{T_TMP_ITM_CELL}] val=E exe=sdcl { "var @itm = () "loop $prf (findDir($dir = ${D_PROFILE_ROOT},'^[^\.]+$','n')) "{loop $cel (findDir(catDir($dir,$prf,'config','cells'),'^[^\.]+$','n')) " {if ?testFile('f',catFile(lastDir(),$cel,'virtualhosts.xml')) " {var $itm = concat($prf,':',$cel) " call push(@itm,$itm,$itm) " } " } "} "var @{T_TMP_ITM_CELL/T} = @itm "if compare('eq',${W_TYPE},'MANY') "{var ${AUX.dft} = '*' " var ${AUX.pck} = true "} "else "{var ${AUX.dft} = '^' " var ${AUX.err} = 'Enter a menu item number only' " var ${AUX.inp} = \ " 'Enter the item number corresponding to the profile:cell to collect' "} } #------------------------------------------------------------------------------ # Select the server(s) #------------------------------------------------------------------------------ [T_SERVERS] typ=M ask=0 bef='Profile:Cell:Node:Server list:' dsc='Profile:Cell:Node:Server list' itm=[@{T_TMP_ITM}] val=E exe=sdcl { "var ($top,@itm) = (${D_PROFILE_ROOT}) "loop $str (@{T_CELLS}) "{var ($prf,$cel) = split(':',$str) " var $dir = catDir($top,$prf,'config','cells',$cel,'nodes') " loop $nod (grepDir($dir,'^[^\.]+$','n')) " {next !?testDir('d',catDir($dir,$nod,'servers')) " loop $srv (grepDir(lastDir(),'^[^\.]+$','n')) " {next !?testFile('f',catFile(lastDir(),$srv,'server.xml')) " var $itm = join(':',$prf,$cel,$nod,$srv) " call push(@itm,$itm,$itm) " } " } "} "var @{T_TMP_ITM/T} = @itm "if compare('eq',${W_TYPE},'MANY') "{var ${AUX.dft} = '*' " var ${AUX.pck} = true "} "else "{var ${AUX.dft} = '^' " var ${AUX.err} = 'Enter a menu item number only' " var ${AUX.inp} = 'Enter the item number corresponding to the \ " profile:cell:node:server to collect' "} } #------------------------------------------------------------------------------ # Identify the users #------------------------------------------------------------------------------ [B_AUTH_AUTO] typ=B dft=false dsc='Use properties file for connecting to IBM WebSphere?' inp='Do you want RDA to use the authentication details stored in the \ properties file when connecting to IBM WebSphere (Y/N)?' lvl=6 var=false:loop_cells [loop_cells] typ=L dft=@{T_CELLS} dsc='Iterate on each cell' nam=-T_CELL var=loop:T_USERS [T_USERS] typ=T dsc="IBM WebSphere user name for '${W_TMP_CEL}' cell" key=${T_CELL} val=E exe=sdcl { "var ($top,$usr) = (${D_PROFILE_ROOT},'') "var ($prf,$cel) = split(':',${T_CELL}) "var ${W_TMP_CEL/T} = $cel "if ?testFile('fr',catFile($top,$prf,'config','cells',$cel,'fileRegistry.xml')) "{if xmlFind(xmlLoadFile(lastFile()),'sdo:datagraph/wim:Root/wim:entities \ " xsi:type="wim:PersonAccount"/wim:uid') " var $usr = xmlData(last) "} "if length($usr) "{var ${AUX.clr} = '-' " if ?${T_USERS}->{$cel} " var ${AUX.dft} = last " else " var ${AUX.dft} = $usr " var ${AUX.err} = 'User name should not contain spacing characters.' " var ${AUX.inp} = "Enter the user name for the IBM WebSphere \ " connection. If a dash (${SPC.AUX.clr}) is specified as \ " input, default user name retrieved from '${W_TMP_CEL}' \ " cell configuration file is considered." " var ${AUX.lvl} = 6 " var ${AUX.ref} = '^\S*$' "} "else "{var ${AUX.err} = 'User name cannot be empty and should not contain spacing \ " characters.' " var ${AUX.inp} = "Enter the user name for the IBM WebSphere \ " connection for '${W_TMP_CEL}' domain" " var ${AUX.ref} = '^\S+$' "} } #------------------------------------------------------------------------------ # Setting definition for determining all relevant WSP homes #------------------------------------------------------------------------------ [get_homes] typ=D dsc='Oracle home or IBM WebSphere installation directory' end='.' nam=D_HOMES exe=sdcl { "var ($top,@hom,%dup) = (${D_PROFILE_ROOT}) "loop $itm (@{T_SERVERS}) "{var ($prf,$cel,$nod,undef) = split(':',$itm) " if ?testFile('fr',catFile(\ " $top,$prf,'config','cells',$cel,'nodes',$nod,'variables.xml')) " {var $obj = xmlLoadFile(lastFile(),xmlDisable(xmlParser(),'BCDEPR')) " var $hom = undef " if xmlFind($obj,\ " 'variables:VariableMap/entries symbolicName=".*ORACLE_HOME$"') " var $hom = xmlValue(last,'value') " elsif xmlFind($obj,\ " 'variables:VariableMap/entries symbolicName="WAS_INSTALL_ROOT"') " var $hom = xmlValue(last,'value') " if ?$hom " call push(@hom,$hom) " } "} "loop $hom (@hom) "{if length($hom) " var $dup{$hom} = true "} "var @{AUX.dft} = keys(%dup) } #------------------------------------------------------------------------------ # Other settings #------------------------------------------------------------------------------ [N_INCIDENT_FILES] typ=N dft=5 dsc='Maximum number of incident directories to collect' err='The number of directories must be a positive integer' inp='How many latest incident directories do you want RDA to collect?' lvl=6 ref='I[0,[' val=F