# LDtfa.ctl: Collects Trace File Analyzer Results # $Id: LDtfa.ctl,v 1.7 2015/08/21 15:34:34 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/DB/LDtfa.ctl,v 1.7 2015/08/21 15:34:34 RDA Exp $ # # Change History # 20150821 MSC Improve time consistency. =head1 NAME DB:LDtfa - Collects Trace File Analyzer Results =head1 DESCRIPTION =head2 tfa - Trace File Analyzer When available, this module collects the most recent Trace File Analyzer results. The collection is performed when the security filter is not enabled. =cut if or(${MOD.DB.TFA.B_NO_TFA},isFiltered()) return if !?cond(${OS.aix}, '/etc/init.tfa',\ ${OS.hpux}, '/sbin/init.d/init.tfa',\ ${OS.linux}, '/etc/init.d/init.tfa',\ ${OS.solaris},'/etc/init.d/init.tfa') return if !grepFile(last,'^\s*(export\s+)?TFA_HOME=','f') return if !?$hom = testDir('d',trim(value(last),'[\042\047]')) return debug ' Inside LOAD module, gathering Trace File Analyzer information' # Purge old reports and create the directory when needed call setAbbr($abr = 'DB_TFA_') call purge('e',$abr,0,0,true) # Determine the repository locations var ($cnt, %dir) = (${MOD.DB.TFA.N_ZIP:1}) loop $dir (grepCommand([catCommand($hom,'bin','tfactl'),'print','repository'],\ '^\s*\|\s*Location\s*\|\s*(.*?)\s*\|','1')) incr $dir{$dir},$cnt if !scalar(%dir) {if ?testDir('d',catDir($hom,'repository')) incr $dir{lastTestDir()},$cnt } # Collect Trace File Analyzer information report tfa prefix {write '---+ Trace File Analyzer Files' write ' * Links point to files that have been collected in their original \ format. Opening them directly in your browser can present risks. \ To prevent them, access the file outside the browser or use the \ link to save them and use an adequate viewer.' write '|*File Name*| *Size*|*Last Modified Date*|' } loop $dir (keys(%dir)) {var $max = $dir{$dir} loop $fil (grepDir($dir,'\.zip$','irt')) {var $src = basename($fil) var $dst = concat($abr,replace(substr($src,0,-4),'[_\W]+','_',true),'.zip') if transfer(dirname($fil),$src,${OUT.E},$dst,true) {write '|[[../extern/',$dst,'][_blank][',$src,']] | ',getSize($fil),\ '|',getLastModify($fil,''),' |' decr $max break !$max } } } if isCreated(true) toc '2:[[',getFile(),'][rda_report][Trace File Analyzer]]' =begin credits =over 10 =item RDA 8.00: Jaime Alcoreza, Terri Nasshan. =item RDA 8.01: Jaime Alcoreza. =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