# DSCVr11.ctl: Defines Common Macros for Oracle Discoverer 11g # $Id: DSCVr11.ctl,v 1.4 2013/10/30 07:18:34 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/OFM/DSCVr11.ctl,v 1.4 2013/10/30 07:18:34 RDA Exp $ # # Change History # 20130421 MSC Improve the validation. =head1 NAME OFM:DSCVr11 - Defines Common Macros for Oracle Discoverer 11g =head1 DESCRIPTION This persistent submodule regroups macros that are common to Oracle Discoverer in Oracle Fusion Middleware 11g. The following macro is available: =cut # Make the module persistent and share macros keep $KEEP_BLOCK,@SHARE_MACROS var @SHARE_MACROS = ('collect_dscv_instance') # Load the common macros run RDA:library() =head2 S This macro collects Oracle Discoverer instance information. =cut macro collect_dscv_instance {var ($pre,$top,\%cmp) = @arg import $MAX,$TAIL,$TOP # Collect the instance database, portlet and web services information var $env = setLocalEnv('TNS_ADMIN',catDir($top,'config')) var $fil = first(grepDir(\ catDir($top,'config','WebCache'),'^webcache\.xml$','fr',1)) run OFM:DSCVinfo(true,true,$fil) call setLocalEnv('TNS_ADMIN',$env) # Collect the instance files debug ' - Getting Oracle Discoverer status, configuration and log files' loop $key (keys(%cmp)) {var ($typ,$cmp) = split('\|',$key,2) next !match($typ,'^PreferenceServer$',true) debug ' - ',$cmp,' component' call setPrefix(concat($pre,'_c_',$cmp)) pretoc "2:'",$cmp,"' Discoverer Component" # Get the Discoverer status report check_discoverer if isUnix() {var $pgm = catCommand($top,'Discoverer',$cmp,'util','checkdiscoverer.sh') var $cmd = concat($pgm,' 2>&1') } elsif or(isWindows(),isCygwin()) {var $pgm = catCommand($top,'Discoverer',$cmp,'util','checkdiscoverer.bat') var $cmd = concat($pgm,' -nopause 2>&1') } else var $pgm = undef if ?testFile('fr',$pgm) {write '---+!! Discoverer Status' write '---## Using: ',encode($cmd) if !writeCommand($cmd) write '** Error running checkdiscoverer command **%BR%' write $TOP toc '3:[[',getFile(),'][rda_report][Discoverer Status]]' } # Collect the configuration files pretoc '3:Configuration Files' call sort_files(4,$TAIL,\ grepDir(catDir($top,'config',$typ,$cmp),\ '^pref\.txt$|\.(conf|dc|sh|xml)$',\ 'dir')) unpretoc # Collect the log files, including error.txt pretoc '3:Log Files' var ($cnt,$dir) = ($MAX,catDir($top,'diagnostics','logs',$typ,$cmp)) if expr('>',$cnt,0) {loop $fil (grepDir($dir,'\.xml$','ipt')) {if ?testFile('f',$fil) {var $nam = basename($fil) report concat('l_',$nam) write '---+ Display of ',encode($nam),' File' write '---## Information Taken from ',encode($fil) var $flg = writeFile($fil) if !$flg {write '**',encode($nam),' not readable.**%BR%\ May be file permission problems.%BR%\ Permissions are:%BR%' call statFile('b',$fil) write 'User: ',id(),'%BR%' } toc '4:[[',getFile(),'][rda_report][',$nam,']]' } decr $cnt break !$cnt } } call sort_files(4,$TAIL,\ grepDir($dir,'\.(log|txt)$','inp'),\ grepDir(catDir($top,'diagnostics','logs','Discoverer',$cmp),\ '\.(txt|log)$','inp'),\ grepDir(catDir($top,'diagnostics','logs','SessionServer',$cmp),\ '\.(txt|log)$','inp')) unpretoc 2 } call setPrefix($pre) } =head1 SEE ALSO L, L =begin credits =over 10 =item RDA 4.15: Greg Cook, Andrew Salt. =back =end credits =head1 COPYRIGHT NOTICE Copyright (c) 2002, 2016, 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