# S350WEBC.def: Collects Web Cache Information # $Id: S350WEBC.def,v 1.20 2009/01/30 14:20:29 mschenke Exp $ # ARCS: $Header: /u02/webapps/workbench/cvs/RDA_4/src/scripting/lib/modules/S350WEBC.def,v 1.20 2009/01/30 14:20:29 mschenke Exp $ # # Change History # 20090130 KRA Test for the existence of 'rcu' directory in AS 11g context. =head1 NAME S350WEBC - Collects Web Cache Information =head1 DESCRIPTION This module collects Web Cache information (for example, configuration, DTD, and log files). The following reports can be generated and are regrouped under C: =cut echo tput('bold'),'Processing Web Cache module ...',tput('off') # Initialization var $ORACLE_HOME = getSetting('ORACLE_HOME','') var $WEBC_TAIL = getSetting('WEBCACHE_TAIL',5000) var $WEBCACHE_HOME = catDir($ORACLE_HOME,'webcache') var $MNU = '1:Web Cache' var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' # Collect the Web Cache information if or(getSetting('ASIT_IN_USE'),testDir('d',catDir($ORACLE_HOME,'rcu'))) {# Abort collection when merged if getSetting('ASIT_MERGE',true) {echo "WEBC collection performed by the ASIT module" return } # Load the common macros var ($CNT,%DUP) = (0) run WEBCr11() # Collect generic information pretoc $MNU pretoc '1+:Oracle Home' call collect_webc_generic($WEBCACHE_HOME) unpretoc # Collect the data for each instance var $hom = catDir(getSetting('ASIT_INSTANCE_HOME','')) var %cmp loop $ins (get_instances($hom,'ASIT_INSTANCES')) {# Get the instance name and its associated components var $dir = catDir($hom,$ins) var $dsc = get_components(\%cmp,$dir,$ins,'^WebCache$') # Skip instances without relevant components next !keys(%cmp) # Treat relevant components debug ' Inside WEBC module, analyzing instance ',$dsc if isTocCreated(true) pretoc '%SPLIT%' else pretoc $MNU pretoc "1+:'",$dsc,"' Instance" call collect_webc_instance($dsc,$dir,\%cmp) unpretoc 2 } } else {# Load the common macros run library() # Collect configuration files related to Web Cache pretoc $MNU debug ' Inside WEBC module, gathering Web Cache configuration files' pretoc '2:Config Files' var $dir = $WEBCACHE_HOME call cat_report($dir,'webcache.xml') call cat_report($dir,'internal.xml') call cat_report($dir,'webcachetargets.xml') unpretoc # Collect DTD files related to Web Cache debug ' Inside WEBC module, gathering Web Cache DTD files' pretoc '2:DTD Files' var $dir = catDir($WEBCACHE_HOME,'dtds') call cat_report($dir,'wcstats.dtd') call cat_report($dir,'webcache.dtd') call cat_report($dir,'webcache20.dtd') unpretoc =pod Log files can be relocated. Because of this, RDA parses a few xml files to get their location, and then dumps them. =cut # Collect log files related to Web Cache debug ' Inside WEBC module, gathering Web Cache log files' pretoc '2:Log Files' macro get_param {var ($fil,$re1,$re2,$val) = @arg import $ORACLE_HOME if testFile('r',$fil) {if grepFile($fil,$re1) {var ($val) = (last) var $val = replace($val,$re2) var $val = field('"',0,$val) var $val = replace($val,'\?',$ORACLE_HOME) } } return $val } # Let's do the web cache access_log var $dir = catDir($WEBCACHE_HOME,'logs') var $fil = catFile($WEBCACHE_HOME,'webcache.xml') var $log = get_param($fil,'ACCESSLOG.*LOGDIR','^.*LOGDIR="',$dir) call tail_report($log,'access_log',$WEBC_TAIL) # Now let's do the web cache tracedump file var $log = get_param($fil,'TRACEDUMP.*FILENAME','^.*FILENAME="') if $log call head_report(dirname($log),basename($log),$WEBC_TAIL) else call head_report($dir,'tracedump',$WEBC_TAIL) # Now let's do the web cache IOLOGGER file var $log = get_param($fil,'IOLOGGER.*FILENAME','^.*FILENAME="') if $log call tail_report(dirname($log),basename($log),$WEBC_TAIL) else call tail_report($dir,'io_log',$WEBC_TAIL) # Let's do the web cache event_log. var $log = get_param($fil,'EVENTLOGDIR.*LOGDIR','^.*LOGDIR="',$dir) var $nam = get_param($fil,'EVENTLOG.*FILENAME','^.*FILENAME="','event_log') call tail_report($log,$nam,$WEBC_TAIL) unpretoc =head2 perms - File Permissions Collects the owner and group permissions of the files used by Web Cache. =cut debug ' Inside WEBC module, gathering Web Cache File Permissions' var $dir = $WEBCACHE_HOME if testDir('d',$dir) {report perms write '---+ Web Cache File Permissions' loop $fil ($dir,grepDir($dir,'^[\.]+$','vr')) {next !testDir('d',$fil) call statDir('an',$fil) } if isCreated(true) {toc '2:[[',getFile(),'][rda_report][File Permissions]]' } } } =head2 not_found - Not found Used as a warning when none of the Web Cache files are found. =cut if !isTocCreated(true) {debug ' Inside WEBC module, no file found' report not_found write 'No Web Cache files were found. This does not mean there was \ necessarily a problem with RDA, but it should be investigated.' toc $MNU toc '2:[[',getFile(),'][rda_report][Not found]]' } =head1 SEE ALSO L, L =begin credits =over 10 =item RDA 4.9: Marcus Lachmanez, Mark Templeton. =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