# S321TUX.def: Collects Oracle Tuxedo Information # $Id: S321TUX.def,v 1.4 2012/01/03 13:34:45 mschenke Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_4/src/scripting/lib/modules/S321TUX.def,v 1.4 2012/01/03 13:34:45 mschenke Exp $ # # Change History # 20120103 MSC Change the copyright notice. =head1 NAME S321TUX - Collects Oracle Tuxedo Information =head1 DESCRIPTION This module collects Oracle Tuxedo-related information. The module covers Oracle Tuxedo Release 9.1 and later. The following reports can be generated and are regrouped under C: =head1 REPORTS =cut echo tput('bold'),'Processing TUX module ...',tput('off') # Initialization var $CFG = getSetting('TUX_CONFIG','') var $DOM_CFG = getSetting('TUX_DOM_CONFIG','') var $HOME = getSetting('TUX_HOME','') var $LOG_PRE = getSetting('TUX_LOG_PREFIX') var $TAIL = getSetting('RDA_TAIL',1000) if !length($LOG_PRE) var $LOG_PRE = undef var $DOMCMD = catCommand($HOME,'bin',${AS.EXE:'dmunloadcf'}) var $TUXCMD = catCommand($HOME,'bin',${AS.EXE:'tmunloadcf'}) var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' pretoc '1:Oracle Tuxedo' # Load the common macros run library() # Set the Tuxedo environment var $env{'BDMCONFIG'} = setEnv('BDMCONFIG',$DOM_CFG) var $env{'TUXCONFIG'} = setEnv('TUXCONFIG',$CFG) var $env{'TUXDIR'} = setEnv('TUXDIR',$HOME) var $env{'ULOGPFX'} = setEnv('ULOGPFX',$LOG_PRE) # Include Tuxedo library directory to the library path if ${CUR.SHLIB} {if testDir('e',catDir($HOME,'lib')) {loop $key (@{CUR.SHLIB}) {var $lib = getEnv($key,undef,true) call setEnv($key,join(${RDA.SEPARATOR},lastDir(),$lib)) var $env{$key} = $lib } } } =head2 release_info - Release Information Gathers Oracle Tuxedo release-related information. =cut debug ' Inside TUX module, gathering release information' report release_info var $cmd = concat(catCommand($HOME,'bin',${AS.EXE:'tmadmin'}),' -v') prefix {write '---+ Oracle Tuxedo Release Information' write '---## Using: ',encode($cmd) } call writeCommand(concat($cmd,' 2>&1')) if isCreated(true) toc '2:[[',getFile(),'][rda_report][Release Information]]' =head2 tmunloadcf - Configuration Information F translates the F configuration file from the binary representation into text format. =cut var $DFT_DIR = $DFT_PRE = '' if testFile('fr',$CFG) {debug ' Inside TUX module, collecting configuration data' report tmunloadcf prefix {write '---+ Display of Oracle Tuxedo Text Configuration Information' write '---## Using: ',encode($TUXCMD) } call loadCommand(concat($TUXCMD,' 2>&1')) call writeLastFile() if grepLastFile('\bAPPDIR=([\042\047]).*?\1','f') var (undef,$DFT_DIR) = match(last,'\bAPPDIR=([\042\047])(.*?)\1') if grepLastFile('\bULOGPFX=([\042\047]).*?\1','f') var (undef,$DFT_PRE) = match(last,'\bULOGPFX=([\042\047])(.*?)\1') if hasOutput(true) {write $TOP toc '2:[[',getFile(),'][rda_report][Configuration Information]]' } } =head2 dmunloadcf - Domain Configuration Information F translates the F configuration file from the binary representation into text format. =cut if testFile('fr',$DOM_CFG) {debug ' Inside TUX module, collecting domain configuration data' report dmunloadcf prefix {write '---+ Display of Oracle Tuxedo Domain Text Configuration Information' write '---## Using: ',encode($DOMCMD) } call writeCommand(concat($DOMCMD,' 2>&1')) if hasOutput(true) {write $TOP toc '2:[[',getFile(),'][rda_report][Domain Configuration Information]]' } } =head2 Log Files Gathers Oracle Tuxedo-related log files. =head2 tux_log_error - Oracle Tuxedo Log Error RDA reports when there are no log files found using the C value specified at setup time. It attempts to find the logs through configuration information. =cut macro log_default {var ($pre,$dft) = @arg import $TAIL if length($pre) {call sort_files(3,$TAIL,\ grepDir(dirname($pre),concat('^',quote(basename($pre)),'\.\d{6}$'),'ip')) } elsif length($dft) call sort_files(3,$TAIL,grepDir($dft,'^ULOG\.\d{6}$','ip')) } debug ' Inside TUX module, collecting the log files' pretoc '2:Log Files' if !?$LOG_PRE call log_default($DFT_PRE,$DFT_DIR) elsif grepDir(dirname($LOG_PRE),\ concat('^',quote(basename($LOG_PRE)),'\.\d{6}$'),'ip') call sort_files(3,$TAIL,last) else {report tux_log_error write '**Note:**%BR%\ RDA did not find log files with the ULOGPFX value specified at setup \ time: ',$LOG_PRE,'%BR%RDA made an another attempt using the \ configuration information.' toc '3:[[',getFile(),'][rda_report][Oracle Tuxedo Log Error]]' call log_default($DFT_PRE,$DFT_DIR) } unpretoc 2 # Restore the initial environment loop $key (keys(%env)) call setEnv($key,$env{$key}) =head1 SEE ALSO L =begin credits =over 10 =item RDA 4.23: Serge Bergere. =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