# S350WEBC.def: Collects Web Cache Information # $Id: S350WEBC.def,v 1.16 2008/02/25 17:32:55 mschenke Exp $ # ARCS: $Header: /home/cvs/repository/RDA_4/src/scripting/lib/modules/S350WEBC.def,v 1.16 2008/02/25 17:32:55 mschenke Exp $ # # Change History # 20080225 MSC Change the copyright notice. =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 $TAIL = getSetting('WEBCACHE_TAIL',5000) pretoc '1:Web Cache' # Load the common macros run library() # Collect configuration files related to Web Cache debug ' Inside WEBC module, gathering Web Cache configuration files' pretoc '2:Config Files' var $dir = catDir($ORACLE_HOME,'webcache') 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($dir,'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($ORACLE_HOME,'webcache','logs') var $fil = catFile($ORACLE_HOME,'webcache','webcache.xml') var $log = get_param($fil,'ACCESSLOG.*LOGDIR','^.*LOGDIR="',$dir) call tail_report($log,'access_log',$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),$TAIL) else call head_report($dir,'tracedump',$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),$TAIL) else call tail_report($dir,'io_log',$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,$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 = catDir($ORACLE_HOME,'webcache') 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() {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 '2:[[',getFile(),'][rda_report][Not found]]' } =head1 SEE ALSO See also L. =begin credits =over 10 =item RDA 4.9: Marcus Lachmanez, Mark Templeton. =back =end credits =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