# DCgtw.ctl:125:Collects Transparent/Procedural Gateway Information # $Id: DCgtw.ctl,v 1.5 2013/11/08 15:16:37 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/OS/DCgtw.ctl,v 1.5 2013/11/08 15:16:37 RDA Exp $ # # Change History # 20131108 MSC Improve table of content generation. =head1 NAME OS:DCgtw - Collects Transparent/Procedural Gateway Information =head1 DESCRIPTION This module collects Transparent/Procedural Gateway information (for example, initialization, trace, and log files) The following reports can be generated and are regrouped under C: =cut echo tput('bold'),'Processing OS.GTW module ...',tput('off') # Initialization var $ORACLE_HOME = ${SET.RDA.BEGIN.D_ORACLE_HOME:''} var $TRACE = ${N_TRACE:5} var $TAIL = ${N_TAIL:${DFT.N_TAIL:1000}} var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' var @TTL = () pretoc '1:Gateways' =head2 Gateway Information Collects the initialization files (that is, the C<*.map>, C<*.ora> C<*.sh> files from the F directory) and the last lines of the 5 most recent trace and log files for the following: =over 2 =item o Transparent gateway for DRDA =item o Transparent gateway for Informix =item o Transparent gateway for Ingres =item o Transparent gateway for Microsoft SQL Server =item o Transparent gateway for Sybase =item o Transparent gateway for Teradata =item o Procedural gateway for APPC =item o Procedural gateway for IBM MQ Series =back Depending on the operating system, only a subset of the gateways will be captured. =cut macro collect {var ($gtw,$ttl) = @arg import $ORACLE_HOME,@TTL keep $ORACLE_HOME,@TTL debug ' Inside Gateway module, about to gather ',$gtw,' information' if ?testDir('d',catDir($ORACLE_HOME,$gtw)) {pretoc '2:For ',$ttl pretoc '3:Initialization Files' call get_admin($gtw,'admin') unpretoc pretoc '3:Log Files' call get_log($gtw,'log') unpretoc pretoc '3:Trace Files' call get_log($gtw,'trace') unpretoc 2 } } macro get_admin {var ($gtw,$typ) = @arg import $ORACLE_HOME keep $ORACLE_HOME var $dir = catDir($ORACLE_HOME,$gtw,$typ) var $pre = join('_',$gtw,$typ) loop $nam (grepDir($dir,'\.(map|ora|sh)$','in')) {var $fil = catFile($dir,$nam) report concat($pre,$nam) write '---+ Display of ',encode($nam),' File' write '---## Information Taken from ',encode($fil) if !writeFile($fil) {write '**',encode($nam),' not readable.**%BR%\ May be file permission problems.%BR%\ Permissions are:%BR%' call statFile('b',$fil) write 'User: ',id(),'%BR%' } if isCreated() toc '4:[[',getFile(),'][rda_report][',$nam,']]' } } macro get_log {var ($gtw,$typ) = @arg import $ORACLE_HOME,$TAIL,$TRACE keep $ORACLE_HOME,$TAIL,$TRACE var $cnt = $TRACE var $dir = catDir($ORACLE_HOME,$gtw,$typ) var $pre = join('_',$gtw,$typ) loop $nam (grepDir($dir,'.','t')) {break !$cnt next !?testFile('f',$fil = catFile($dir,$nam)) decr $cnt report concat(nvl($pre,''),$nam) write '---+ Last ',$TAIL,' Lines of ',encode($nam),' File' write '---## Information Taken from ',encode($fil) if !writeTail($fil,$TAIL) {write '**',encode($nam),' not readable.**%BR%\ May be file permission problems.%BR%\ Permissions are:%BR%' call statFile('b',$fil) write 'User: ',id(),'%BR%' } if isCreated() toc '4:[[',getFile(),'][rda_report][',$nam,']]' } } call collect('tg4drda','DRDA') call collect('tg4ifmx','Informix') call collect('tg4ingr','Ingres') call collect('tg4msql','Microsoft SQL Server') call collect('tg4sybs','Sybase') call collect('tg4tera','Teradata') call collect('pg4appc','APPC') call collect('pg4mqseries','IBM MQ Series') call collect('pg4mq','IBM MQ Series') =head2 dblinks - Database Links When the database is installed, it lists the database links that are defined. No passwords are collected. =cut if ${SET.DB.DB.I_DB} {call setSqlTarget(last) debug ' Inside Gateway module, about to gather database links' report dblinks prefix {write '---+ Database Links' write '|*Name*|*Owner*|*Username*|*Host*|' } set $sql {SELECT '|' || " db_link || '|' || " owner || '|' || " username || '|' || " host || ' |' " FROM dba_db_links " ORDER BY db_link; } call writeSql($sql) if getSqlMessage() write last,'%BR%' if isCreated(true) toc '2:[[',getFile(),'][rda_report][Database Links]]' } =head2 not_found - Not found Used as a warning when transparent or procedural gateway or database links information is found. =cut if !isTocCreated() {debug ' Inside Gateway module, no information found' report not_found write 'Neither transparent or procedural gateway files nor database links \ were found and all files were optional. This does not mean there was \ necessarily a problem with RDA, but it should be investigated.' toc '2:[[',getFile(),'][rda_report][Not found]]' } =begin credits =over 10 =item RDA 4.0: Ed Bangma. =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