# DSCVr11.def: Defines Common Macros for Oracle Discoverer 11g # $Id: DSCVr11.def,v 1.5 2009/08/07 13:10:54 mschenke Exp $ # ARCS: $Header: /u02/webapps/workbench/cvs/RDA_4/src/scripting/lib/modules/DSCVr11.def,v 1.5 2009/08/07 13:10:54 mschenke Exp $ # # Change History # 20090709 DEM Collect error.txt. =head1 NAME DSCVr11 - Defines Common Macros for Oracle Discoverer 11g =head1 DESCRIPTION This persistent sub module regroups macros that are common to Oracle Discoverer in Oracle Application Server 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','get_components','get_instances') # Load the common macros run ASITlib() =head2 S This macro collects Oracle Discoverer instance information. =cut macro collect_dscv_instance {var ($dsc,$top,\%cmp) = @arg import $MAX,$TAIL,$TOP # Collect the instance files debug ' - Getting Oracle Discoverer status, configuration and log files' var $abr = setAbbr() var $pre = concat('^',quote($top),'\b') loop $key (keys(%cmp)) {var ($typ,$cmp) = split('\|',$key,2) next !match($typ,'^PreferenceServer$',true) debug ' - ',$cmp,' component' call setAbbr(concat($abr,'i_',$dsc,'_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 isWindows() {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_results(4,$TAIL,$pre,'$OI',\ 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 } } var $fil = catFile($dir,'error.txt') if testFile('rs',$fil) {report error_txt prefix {write '---+ Display of error.txt File' write '---## Information Taken from ',encode($fil) } call writeFile($fil) if isCreated(true) toc '4:[[',getFile(),'][rda_report][error.txt]]' } unpretoc 2 } call setAbbr($abr) } =head1 SEE ALSO L =begin credits =over 10 =item RDA 4.15: Greg Cook, Andrew Salt. =back =end credits =head1 COPYRIGHT NOTICE Copyright (c) 2002-2009, Oracle. All rights reserved. =head1 TRADEMARK NOTICE Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. =cut