# DCtux.ctl:321:Collects Oracle Tuxedo Information # $Id: DCtux.ctl,v 1.6 2013/12/19 14:44:05 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/OFM/DCtux.ctl,v 1.6 2013/12/19 14:44:05 RDA Exp $ # # Change History # 20131219 KRA Fix spell. =head1 NAME OFM:DCtux - 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 OFM.TUX module ...',tput('off') # Initialization var $CFG = ${F_CONFIG:''} var $DOM_CFG = ${F_DOM_CONFIG:''} var $HOME = ${D_HOME:''} var $LOG_PRE = ${T_LOG_PREFIX} var $TAIL = ${DFT.N_TAIL:1000} if !length($LOG_PRE) var $LOG_PRE = undef var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' pretoc '1:Oracle Tuxedo' # Load the common macros run RDA:library() # Set the Tuxedo environment var $env = {BDMCONFIG => $DOM_CFG,\ TUXCONFIG => $CFG,\ TUXDIR => $HOME,\ ULOGPFX => $LOG_PRE} if and(${CUR.W_SHLIB},testDir('d',catDir($HOME,'lib'))) {loop $key (@{CUR.W_SHLIB}) var $env->{$key} = join(${RDA.T_SEPARATOR},lastTestDir(),@{SYS.${VAR.key}}) } var $bkp = setContext($env) =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_DTL = $DFT_ERR = $DFT_OUT = $DFT_PRE = $DFT_TLOG = '' var $DFT_DTN = $DFT_TLN = undef var %DFT_ENV = () if ?testFile('fr',$CFG) {debug ' Inside TUX module, collecting configuration data' report tmunloadcf var $cmd = catCommand($HOME,'bin',${AS.EXE:'tmunloadcf'}) prefix {write '---+ Display of Oracle Tuxedo Text Configuration Information' write '---## Using: ',encode($cmd) } call loadCommand(concat($cmd,' 2>&1')) call writeLastFile() if grepLastFile('\bAPPDIR=([\042\047])(.*?)\1','f2') var $DFT_DIR = first if grepLastFile('\bULOGPFX=([\042\047])(.*?)\1','f2') var $DFT_PRE = first if grepLastFile('\bTLOGDEVICE=([\042\047])(.*?)\1','f2') var $DFT_TLOG = first if grepLastFile('\bTLOGNAME=(.*?)','f1') var $DFT_TLN = first if grepLastFile('\bDMTLOGDEVICE\s*=\s*([\042\047])(.*?)\1','f2') var $DFT_DTL = first if grepLastFile('\bDMTLOGNAME\s*=\s*([\042\047])(.*?)\1','f2') var $DFT_DTN = first if grepLastFile('\bAOUT.*?CLOPT=.*?-e\s*(.*?)\s*-','f1') var $DFT_ERR = first if grepLastFile('\bAOUT.*?CLOPT=.*?-o\s*(.*?)\s*-','f1') var $DFT_OUT = first if grepLastFile('\bENVFILE=([\042\047])(.*?)\1','2') {loop $fil (last) var $DFT_ENV{$fil} = true } if isCreated(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 var $cmd = catCommand($HOME,'bin',${AS.EXE:'dmunloadcf'}) prefix {write '---+ Display of Oracle Tuxedo Domain Text Configuration Information' write '---## Using: ',encode($cmd) } call writeCommand(concat($cmd,' 2>&1')) if isCreated(true) {write $TOP toc '2:[[',getFile(),'][rda_report][Domain Configuration Information]]' } } =head2 rm_cfg - Resource Manager Configuration Gathers resource manager configuration information. =cut if ?$fil = testFile('fr',catFile($HOME,'udataobj','RM')) {debug ' Inside TUX module, collecting resource manager configuration file' report rm_cfg prefix {write '---+ Resource Manager Configuration Information' write '---## Information Taken from ',encode($fil) } call writeFile($fil) if isCreated(true) {write $TOP toc '2:[[',getFile(),'][rda_report][Resource Manager Configuration]]' } } =head2 Environment Files Gathers Oracle Tuxedo-related environment files. =cut debug ' Inside TUX module, collecting the environment files' pretoc '2:Environment Files' call sort_files(3,0,keys(%DFT_ENV)) unpretoc =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. =head2 Log Files Gathers Oracle Tuxedo-related log files. =cut macro log_default {var ($pre,$dft,$pat) = @arg import $TAIL if length($pre) {call sort_files(3,$TAIL,\ grepDir(dirname($pre),\ concat('^',verbatim(basename($pre)),'(\.\d{6})?$'),'ip')) } elsif length($dft) call sort_files(3,$TAIL,grepDir($dft,concat('^',$pat,'(\.\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,'ULOG') elsif grepDir(dirname($LOG_PRE),\ concat('^',verbatim(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,'ULOG') } =head3 Transaction Log Files Gathers transaction log files. =cut debug ' Inside TUX module, collecting transaction log files' pretoc '3:Transaction Log Files' if ?$DFT_TLN call log_default($DFT_TLOG,'',last) else call log_default('',$DFT_TLOG,'TLOG') unpretoc =head3 Domain Transaction Log Files Gathers domain transaction log files. =cut debug ' Inside TUX module, collecting domain transaction log files' pretoc '3:Domain Transaction Log Files' if ?$DFT_DTN call log_default($DFT_DTL,'',last) else call log_default('',$DFT_DTL,'DMTLOG') unpretoc =for stopwords Stderr Stdout =head3 Server Stderr/Stdout Files Gathers Oracle Tuxedo server F and F files. It attempts to find the logs through configuration information. =cut debug ' Inside TUX module, collecting server error and output files' pretoc '3:Server Stderr/Stdout Files' call sort_files(4,$TAIL,nvl(testFile('fr',$DFT_ERR),\ testFile('fr',catFile($DFT_DIR,$DFT_ERR)),\ testFile('fr',catFile($DFT_DIR,'stderr'))),\ nvl(testFile('fr',$DFT_OUT),\ testFile('fr',catFile($DFT_DIR,$DFT_OUT)),\ testFile('fr',catFile($DFT_DIR,'stdout')))) unpretoc 3 # Restore the initial environment call restoreContext($bkp) =head1 SEE ALSO L =begin credits =over 10 =item RDA 4.23: Serge Bergere. =item RDA 8.02: Robert Finan. =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