# DCdps.ctl:346:Collects Oracle DSEE Directory Proxy Server Information # $Id: DCdps.ctl,v 1.8 2014/09/26 09:25:28 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/OFM/DCdps.ctl,v 1.8 2014/09/26 09:25:28 RDA Exp $ # # Change History # 20140926 MSC Rename parseFile in parsePath. =head1 NAME OFM:DCdps - Collects Oracle DSEE Directory Proxy Server Information =head1 DESCRIPTION This module collects Oracle Directory Server Enterprise Edition (DSEE) Directory proxy Server-related information. The module covers ODSEE Directory Proxy Server release 6.x and later. The following reports can be generated and are regrouped under C: =head1 REPORTS =cut echo tput('bold'),'Processing OFM.DPS module ...',tput('off') # Initialization var $DPS_HOME = ${D_HOME:''} var $INS_HOME = ${D_INSTANCE_HOME:''} var $MOD = cond(isUnix(),'fx','fr') if ?nvl(testFile($MOD,catFile($DPS_HOME,'bin',${AS.EXE:'dpadm'})),\ testFile($MOD,catFile($DPS_HOME,'dps6','bin',${AS.EXE:'dpadm'}))) var $DPADM = lastTestCommand() else var $DPADM = undef var $BND = ["%s\012",'pseudo','host','DPS_DIRECTORY_MANAGER',\ 'Enter directory manager password:',''] var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' pretoc '1:Directory Proxy Server' # Load the common macros run RDA:library() =head1 DIRECTORY PROXY SERVER INFORMATION =head2 dpsstate - DPS State Information Gathers Oracle DSEE Directory Proxy Server state information on versions 11.1.1.5 and later using F command. =cut var $ver = '' if grepCommand(concat($DPADM,' -V'),'^dpadm\s*:\s*(\S+)\s*','f1') var ($ver) = last if compare('valid',$ver,'11.1.1.5') {debug ' Inside DPS module, gathering state information' if ?testFile($MOD,\ catFile($DPS_HOME,'bin','support_tools',${AS.EXE:'dpsstate'})) {var ($box,$DPSSTATE) = (cleanBox(),lastTestCommand()) if compare('valid',$ver,'11.1.1.7') var $cmd = concat($DPSSTATE,' -i ',quote($INS_HOME),\ ' -o ',$box) else var $cmd = concat($DPSSTATE,' -a ',quote($INS_HOME),\ ' -o ',$box) call command(concat($cmd,' -accesslog -bindlog -connectionlog')) if grepDir($box,'^state\.zip$') {var ($nam) = (last) data $nam var $trg = getRawLink(true) if transfer($box,$nam,${OUT.C},basename(getFile('.'))) {report dpsstate write '---+ DPS State Information' write ' * Links point to files that have been collected in their \ original format. Opening them directly in your browser can \ present security 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*|' write '|[[',$trg,'][_blank][',$nam,']]|' toc '2:[[',getFile(),'][rda_report][DPS State Information]]' } } call cleanBox() } } =head2 param_info - Parameter Information Gathers Oracle DSEE Directory Proxy Server parameter information on versions earlier than 11.1.1.5. =cut else {if ?$DPADM {debug ' Inside DPS module, gathering parameter information' report param_info var $cmd = concat($DPADM,' info ',quote($INS_HOME)) prefix {write '---+ Oracle DSEE Directory Proxy Server Parameter Information' write '---## Using: ',encode($cmd) write '|*Parameter*|*Value*|' } call loadCommand($cmd) loop $lin (getLines()) {var ($key,$val) = split('\s*:\s*',$lin,2) if match($key,'^Non-secure port') var $prt = isPort(trim($val),true) write '|',$key,' |',$val,' |' } if isCreated(true) toc '2:[[',getFile(),'][rda_report][Parameter Information]]' =head2 version_info - Version Information Gathers Oracle DSEE Directory Proxy Server version information on versions earlier than 11.1.1.5. =cut debug ' Inside DPS module, gathering version information' report version_info var $cmd = concat($DPADM,' -V') prefix {write '---+ Oracle DSEE Directory Proxy Server Version Information' write '---## Using: ',encode($cmd) } call writeCommand($cmd) if isCreated(true) toc '2:[[',getFile(),'][rda_report][Version Information]]' } =head2 memory_stat - Memory Statistics Gathers Oracle DSEE Directory Proxy Server instance memory statistics on versions earlier than 11.1.1.5 using the F command. =cut if and(defined($prt),\ or(testFile($MOD,catFile($DPS_HOME,'dsrk','bin',${AS.EXE:'ldapsearch'})),\ testFile($MOD,catFile($DPS_HOME,'dsrk6','bin',${AS.EXE:'ldapsearch'})))) {debug ' Inside DPS module, gathering the instance memory statistics' var $pgm = lastTestCommand() # Get the directory manager var $mgr = 'cn=Proxy Manager' if grepFile(catFile($INS_HOME,'config','conf.ldif'),\ '^configManagerDN:\s*(.*?)\s*$','f1') var ($mgr) = last var $cmd = concat($pgm,' -T -p ',$prt,' -D "',$mgr,'" -j %s -s sub \ -b "cn=monitor" "(&(objectClass=*))" \*') # Produce the report report memory_stat prefix {write '---+ Oracle DSEE Directory Proxy Server Memory Statistics \ Information' write '---## Using: ',encode(sprintf($cmd,'?')) } call writeCommand({cmd => concat($cmd,' 2>&1'),pwf => $BND}) if isCreated(true) {write $TOP toc '2:[[',getFile(),'][rda_report][Memory Statistics]]' } } =head1 INSTANCE INFORMATION =head2 Configuration Files Gathers Oracle DSEE Directory Proxy Server instance-related configuration files on versions earlier than 11.1.1.5. =cut if ?testDir('d',$INS_HOME) {debug ' Inside DPS module, collecting the instance configuration files' pretoc '2:Configuration Files' call sort_files(3,0,catFile($INS_HOME,'config','state'),\ grepDir(catDir($INS_HOME,'config'),'\.ldif','ip')) unpretoc =head2 Log Files Gathers Oracle DSEE Directory Proxy Server instance-related log files on versions earlier than 11.1.1.5. =cut # Macro to get the log files macro get_logs {var (\%log,$pth) = @arg if ?testFile('fr',$pth) var $log{$pth} = 1 var ($dir,$bas) = parsePath($pth) var ($pth) = reverse(grepDir($dir,concat('^',$bas,'\.\d{8}-\d{6}$'),'np')) if ?testFile('fr',$pth) var $log{$pth} = 2 } debug ' Inside DPS module, collecting the instance log files' var (%ACCESSLOG,%ERRORLOG) = () loop $lin (grepFile(catFile($INS_HOME,'config','conf.ldif'),\ '^file_logFileName:','ij')) {var $str = field(':\s*',1,$lin) if !isAbsolute($fil = catFile($str)) var $fil = catFile($INS_HOME,$fil) if match($str,'access') call get_logs(\%ACCESSLOG,$fil) elsif match($str,'errors') call get_logs(\%ERRORLOG,$fil) } pretoc '2:Log Files' call sort_files(3,0,keys(%ACCESSLOG),keys(%ERRORLOG)) unpretoc } } unpretoc =head1 SEE ALSO L =begin credits =over 10 =item RDA 4.26: Lee Trujillo. =item RDA 4.29: Lee Trujillo. =item RDA 4.31: Lee Trujillo. =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