# S600OFA.def: Collects Oracle Fusion Applications Information # $Id: S600OFA.def,v 1.9 2012/05/31 10:42:18 mschenke Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_4/src/scripting/lib/modules/S600OFA.def,v 1.9 2012/05/31 10:42:18 mschenke Exp $ # # Change History # 20120530 KRA Improve the collection. =head1 NAME S600OFA - Collects Oracle Fusion Applications Information =head1 DESCRIPTION This module collects Oracle Fusion Applications-related information. The following reports can be generated and are regrouped under C: =head1 REPORTS =cut echo tput('bold'),'Processing OFA module ...',tput('off') # Initialization var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' pretoc '^1:Oracle Fusion Applications' # Load the common macros run library() # Identify the domains per Oracle WebLogic Server home var (@orp,%dom,%nam,%top) = () loop $key (grepSetting('^OFA_NOD\d+_DOM\d+_REQ_DOMAIN$')) {var $tid = substr($key,0,-11) var $dom = catDir(getSetting($key)) next !testDir('d',$dom) if missing($dom{$dom}) var $dom{$dom} = addTarget('DOM_Req$$',{DOMAIN_HOME =>$dom,\ MISSING_HOME =>1,\ MISSING_COMMON=>1}) if and(defined($par = $dom{$dom}->get_wl_home),\ testDir('d',$par->get_info('wlh'))) call push($top{$par->get_info('oid')},$tid) else call push(@orp,$tid) var $nam{$tid} = basename($dom) } # Identify the relevant deployed applications var (%clu,%fam) = () loop $key (grepSetting('^OFA_NOD\d+_DOM\d+_REQ_DOMAIN$')) {var $tid = substr($key,0,-11) var $top = catDir(getSetting($key)) next !testDir('d',$top) var $dom = pop(splitDir($top)) var $lst = getSetting(concat($tid,'_WLS_SERVERS')) if testFile('fr',catFile($top,'config','config.xml')) {var $obj = xmlLoadFile(lastFile(),xmlDisable(xmlParser(),'BCDEPR')) next ! match(xmlData(xmlFind($obj,'domain/name')),quote($dom),true) loop $xml (xmlFind($obj,'domain/server')) {if match(xmlData(xmlFind($xml,'name')),concat('^(',$lst,')$'),true) {if xmlFind($xml,'cluster') var $clu{xmlData(last)} = true } } loop $xml (xmlFind($obj,'domain/app-deployment')) {loop $clu (keys(%clu)) {next !match(xmlData(xmlFind($xml,'target')),concat('\b',quote($clu),'\b')) var $pth = xmlData(xmlFind($xml,'source-path')) var @dir = splitDir($pth) if compare('eq',$dir[-2],'deploy') var $fam{$dir[-3],$pth} = xmlData(xmlFind($xml,'name')) } } } } =head2 Configuration Files Gathers all C and C configuration files from F<$MW_HOME/applications/$PRODUCT_FAMILY/deploy> and F<$MW_HOME/applications/$PRODUCT_FAMILY/deploy/$PRODUCT/adf/META-INF> directory structures. =cut # Report the application specific files per product family debug ' Inside OFA module, gathering deployed application related config files' loop $fam (keys(%fam)) {if isTocCreated() toc '%SPLIT%' pretoc "1+:'",$fam,"' Family" var $flg = true loop $pth (keys($fam{$fam})) {if $flg {var (@dir,@tbl) = (splitDir($pth)) call pop(@dir) loop $fil (grepDir(catDir(@dir),'\.(txt|xml)$','ip')) {next match($fil,'(_|Cred)DeployPlan\.xml$',true) call push(@tbl,$fil) } pretoc '2:Configuration Files' call sort_files(3,0,@tbl) var $flg = false unpretoc } pretoc "2:'",field('\#',0,$fam{$fam,$pth}),"' Application" pretoc '3:Configuration Files' call sort_files(4,0,\ grepDir(catDir($pth,'adf','META-INF'),'\.(txt|xml)$','ip')) unpretoc 2 } unpretoc } =head2 Oracle WebLogic Server Domain Information It includes all reports produced by the WREQ module for the specified Oracle WebLogic Server domains. =cut # Report the domains per Oracle WebLogic Server home var $cnt = 0 loop $oid (keys(%top)) {var ($flg,$tid) = ($cnt,replace($top{$oid}->[0],'_DOM','_TOP')) incr $cnt toc '%PUSH("%SPLIT%")%' toc '%PUSH("1+:Oracle WebLogic Server Overview")%' toc '%INCLUDE("',${CUR.GROUP},'_WREQ_',$tid,'.toc")%' toc '%POP2%' loop $tid (@{$top{$oid}}) {toc '%PUSH("%SPLIT%")%' toc '%PUSH("1+:',"'",$nam{$tid},"'",' Domain")%' toc '%INCLUDE("',${CUR.GROUP},'_WREQ_',$tid,'.toc")%' toc '%POP2%' } } # Report domains that are not associated to a Oracle WebLogic Server home pretoc '%PUSH("0: * Orphan Domains")%' loop $tid (@orp) {toc '%PUSH("%SPLIT%")%' toc '%PUSH("1+:',"'",$nam{$tid},"'",' Domain")%' toc '%INCLUDE("',${CUR.GROUP},'_WREQ_',$tid,'.toc")%' toc '%POP2%' } if hasTocOutput(true) toc '%POP%' unpretoc =head1 SEE ALSO L, L =begin credits =over 10 =item RDA 4.22: Sunder Subramanyan. =item RDA 4.24: Richard Bingham, Amit Jain, Goutam Mandal, Sunder Subramanyan. =item RDA 4.28: Richard Bingham. =back =end credits =head1 COPYRIGHT NOTICE Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. =head1 TRADEMARK NOTICE Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. =cut