# S999END.def: Finalizes the Data Collection # $Id: S999END.def,v 1.43 2008/02/05 16:28:38 mschenke Exp $ # ARCS: $Header: /home/cvs/repository/RDA_4/src/scripting/lib/modules/S999END.def,v 1.43 2008/02/05 16:28:38 mschenke Exp $ # # Change History # 20080205 DEM Collect 'System Information' before 'Report Settings'. =head1 NAME S999END - RDA Module Finalizing the Data Collection =head1 DESCRIPTION =cut echo tput('bold'),'Processing End module ...',tput('off') # Initialization var $SEP = repeat('-',79) var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' # Identify the login name call setSetting('LOGNAME',user(),'T','Login name') # Identify the operating system module var $run = check(getOsName(),'aix', 'OSaix',\ 'darwin', 'OSdarwin',\ 'dec_osf', 'OSosf',\ 'dynixptx', 'OSptx',\ 'hpux', 'OShpux',\ 'linux', 'OSlinux',\ 'solaris', 'OSsunos',\ cond(isWindows(), 'OSwin32',\ isUnix(), 'OSunix',\ isVms(), 'OSvms')) =head2 system - System Information Collects key system configuration for the CFG module. =cut debug ' Inside END module, gathering system information' report system write '---+ System Information' run &{$run}('END_system') var $rpt = getFile('/') =head2 report - Report Settings Produces an overview report of the main current settings and the data collection, as well as some statistics about the SQL statement and operating system command execution for the CFG module. =cut debug ' Inside END module, producing setting overview' report report write '---+!! Oracle Remote Diagnostic Agent (RDA)' write 'Written by: Oracle Global Customer Support%BR%\ Version: %VERSION%%BR%\ Report created on: ',getSetting('LAST_RUN_S999END') write if isRendered() {var $hdr = 'System Settings' var @hdr = (concat('[[#%HDR%][',$hdr,']]')) loop $mod (getModules()) {var $val = getSetting(replace($mod,'.def','_TITLE',true)) if compare('ne',$val,$hdr) {var $hdr = $val var @hdr = (@hdr,concat('[[#%HDR%][',$hdr,']]')) } } var @hdr = (@hdr,\ '[[#%HDR%][Data Collection Overview]]',\ '[[#%HDR%][SQL Request Overview]]',\ '[[#%HDR%][Operating System Command Execution Overview]]',\ '[[#%HDR%][XML Command Execution Overview]]') write '%COL3%',join('%BR%',@hdr),'%ENDCOL%' } else write $TOC var $hdr = 'System Settings' write '---+ ',$hdr write $HDR # Load the system settings write '|Machine and version|',uname('a'),'|' write '|Fully qualified host name|',\ getSetting('MACHINE_NAME'),'.',getSetting('DOMAIN_NAME'),'|' run &{$run}('END_report',$rpt) write '|Logged in as|',user(),'|' write '|Last run as|',id(),'|' if isFiltered() write '|%RED%Sensitive information removed?%ENDCOLOR%|%RED%Yes%ENDCOLOR%|' if isUnix() {var $uid= getOwner(getFile('/')) var $own= getOwner(getSetting('ORACLE_HOME','')) if compare('eq',$uid,$own) write '|Executed as Oracle home owner?|Yes|' else write '|Executed as Oracle home owner?|No|' } # Load the module settings loop $mod (getModules()) {var $val = getSetting(replace($mod,'.def','_TITLE',true)) if compare('ne',$val,$hdr) {write $TOP var $hdr = $val write '---+ ',$hdr write $HDR } loop $var (split(',',getSetting(replace($mod,'.def','_SETTINGS',true)))) {var ($val,$dsc) = getDesc($var) if defined($val) write '|',$dsc,'|',replace($val,'\|','%BR%',true),' |' } } write $TOP # Add data collection overview write '---+ Data Collection Overview' write '|*Abbr*|*Module*|*Last Run*|*Comment*|' loop $mod (getModules()) {var ($mod,$abr) = match($mod,'^(S\d{3}(.*))\.def$',true) if getSetting(concat('LAST_RUN_',$mod)) write '|',$abr,'|',$mod,'|',last,'|',\ getSetting(concat('LAST_INFO_',$mod)),' |' } write $TOP # Add module statistics var %ttl = (\ 'SQL','---+ SQL Request Overview',\ 'OS' ,'---+ Operating System Command Execution Overview',\ 'XML','---+ XML Command Execution Overview') var %hdr = (\ 'SQL','|*Abbr*|*Module*| *Requests*| *Errors*| *Time-Out*| *Skipped*|\ *Comment*|',\ 'OS' ,'|*Abbr*|*Module*| *Requests*| *Time-Out*|*Comment*|',\ 'XML','|*Abbr*|*Module*| *Requests*| *Time-Out*|*Comment*|') loop $key ('SQL','OS','XML') {var $flg = match($key,'SQL') prefix {write $ttl{$key} write $hdr{$key} } var ($tot_err,$tot_out,$tot_req,$tot_skp,$tot,@mod) = (0,0,0,0,0) loop $mod (getModules()) {var ($mod,$abr) = match($mod,'^(S\d{3}(.*))\.def$',true) var $nb_req = getSetting(concat($key,'_STAT_',$mod,'_REQ')) if defined($nb_req) {# Generate the module row var $nb_err = getSetting(concat($key,'_STAT_',$mod,'_ERR'),0) var $nb_out = getSetting(concat($key,'_STAT_',$mod,'_OUT'),0) var $nb_skp = getSetting(concat($key,'_STAT_',$mod,'_SKIP'),0) if $flg write '|',$abr,'|',$mod,'| ',\ $nb_req,'| ',$nb_err,'| ',$nb_out,'| ',$nb_skp,'|',\ getSetting(concat($key,'_STAT_',$mod,'_NOTE')),' |' else write '|',$abr,'|',$mod,'| ',$nb_req,'| ',$nb_out,'|',\ getSetting(concat($key,'_STAT_',$mod,'_NOTE')),' |' # Define the contributions to the total line incr $tot_err,$nb_err incr $tot_out,$nb_out incr $tot_req,$nb_req incr $tot_skp,$nb_skp # Identify warning areas if and(compare('ne',$mod,'S000INI'),or($nb_out,$nb_skp)) {var @mod = (@mod,$mod) incr $tot,$nb_out incr $tot,$nb_skp } } } if $tot_req {if $flg write "|''Total''|| ''",\ $tot_req,"''| ''",$tot_err,"''| ''",$tot_out,"''| ''",$tot_skp,"''| |" else write "|''Total''|| ''",\ $tot_req,"''| ''",$tot_out,"''| |" } if hasOutput(true) write $TOP elsif isRendered() {write $ttl{$key} write 'No related modules%BR%' write $TOP } call setSetting(concat($key,'_WARNINGS'),join('|',$tot,@mod),'T',\ concat('Overview of ',$key,' Execution Warnings')) } # Add notes write '---+!! Note' write 'This report only contains basic runtime information. \ All data gathered can be found using the links in the index frame.%BR%' write $TOP =pod Locates packaging commands (for example, tar and zip) and the compression tools (compress or gzip) that are available. =cut debug ' Inside END module, locating packaging commands' if !defined(getEnv('RDA_NO_ZIP')) {if !isVms() call setSetting('CMD_ZIP',findCommand('zip'),'T','Zip command') elsif testCommand('zip -h') call setSetting('CMD_ZIP','zip','T','Zip command') } if isUnix() {if !defined(getEnv('RDA_NO_TAR')) call setSetting('CMD_TAR',findCommand('tar'),'T','Tar command') if !defined(getEnv('RDA_NO_PAX')) call setSetting('CMD_PAX',findCommand('pax'),'T','Pax command') if !defined(getEnv('RDA_NO_GZIP')) call setSetting('CMD_GZIP',findCommand('gzip'),'T','Gzip command') if !defined(getEnv('RDA_NO_COMPRESS')) call setSetting('CMD_COMPRESS',findCommand('compress'),'T','Compress command') } if !defined(getEnv('RDA_NO_JAR')) {if !isVms() call setSetting('CMD_JAR',findCommand('jar'),'T','Jar command') #elsif testCommand('jar -h') # call setSetting('CMD_JAR','jar','T','Jar command') } =pod Stores the time of the last RDA Data Collection execution and indicates the end of the script. =cut call setSetting('RPT_LAST',gmtime('%Y%m%d_%H%M%S'),'T','Last run time stamp') echo $SEP echo 'RDA Data Collection Ended ',localtime('%d-%b-%Y %X') echo $SEP =head1 SEE ALSO See also L, L, L, L, L, L, L, L, L, L. =head1 COPYRIGHT NOTICE Copyright (c) 2002-2008, 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