# S550ESS.def: Collects Oracle Essbase Information # $Id: S550ESS.def,v 2.27 2012/05/25 06:49:41 mschenke Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_4/src/scripting/lib/modules/S550ESS.def,v 2.27 2012/05/25 06:49:41 mschenke Exp $ # # Change History # 20120525 KRA Extend the logs collection. =head1 NAME S550ESS - Collects Oracle Essbase Information =head1 DESCRIPTION This module collects information for Oracle Essbase. The following reports can be generated and are regrouped under C: =cut use Buffer echo tput('bold'),'Processing ESS module ...',tput('off') # Initialization var $EPM_HOME = ${EPM_HOME:${ENV.EPM_ORACLE_HOME:${ENV.HYPERION_HOME:''}}} var $ESS_REQUESTS = getSetting('ESS_REQUESTS') var $TAIL = getSetting('RDA_TAIL',1000) var $AGE = getSetting('ESS_AGE',15) var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' pretoc '1:Oracle Essbase' # Load the common macros run library() macro fmt_bit {var ($val,$flg) = @arg var @bit = ('---','--x','-w-','-wx','r--','r-x','rw-','rwx',\ '--S','--s','-wS','-ws','r-S','r-s','rwS','rws') if $flg incr $val,8 return $bit[$val] } macro fmt_mode {var ($mod) = @arg return concat(substr("?pc?d?b?-?l?s???",expr('&',expr('>>',$mod,12),15), 1),\ fmt_bit(expr('&',expr('>>',$mod,6),7),expr('&',$mod,2048)),\ fmt_bit(expr('&',expr('>>',$mod,3),7),expr('&',$mod,1024)),\ fmt_bit(expr('&',$mod,7), expr('&',$mod,512))) } =head1 PRODUCT REPORTS Collects the following reports on version 11.1.2 and later: =head2 Library Types Collects library file types from the following directories F and F For UNIX, the collection depends on the F command. =cut if ?$ESS_REQUESTS {pretoc '2:Library Types' debug ' Inside ESS module, getting library types' var $cnt = 0 loop $dir (catDir($EPM_HOME,'products','Essbase','EssbaseServer','bin'),\ catDir($EPM_HOME,'products','Essbase','EssbaseServer-32','bin')) {if testDir('d',$dir) {report concat('libtyp',incr($cnt)) if isUnix() {prefix {write '---+!! Shared Library Types' write '---## From ',$dir write '|*File*|*Type*|*Modified*|*Size*|*Mode*|' } var $pat = check(getOsName(),'aix','\.(a|so)$','\.(sl|so)$') loop $fil (grepDir($dir,$pat,'p')) {var ($lin) = command(concat('file ',$fil)) var @sta = getStat($fil) var ($fil,$ver) = split('\:\s+',$lin,2) write '|',basename($fil),' |',$ver,' |',\ getLastModify($fil,'%d-%b-%Y %H:%M:%S'),' | ',\ getSize($fil),'|',fmt_mode($sta[2]),' |' } } elsif or(isWindows(),isCygwin()) {prefix {write '---+!! Executable and Library Version Information' write $TOC } loop $fil (grepDir($dir,'\.(dll|exe)$','ip')) {write '---+ Version Information from ',basename($fil) call statFile('p',$fil) write '%BR%' var $inf = getVersionInfo($fil) loop $key (keys($inf)) write '|*',replace($key,'\012',' ',true),' *|',\ replace($inf->{$key},'\012','%BR%',true),' |' write $TOP } } if isCreated(true) toc '3:[[',getFile(),'][rda_report][',\ encode(replace($dir,$EPM_HOME,'$EPM_HOME')),']]' } } unpretoc =head2 Client Library Types Collects library file types from the following directories F F For UNIX, the collection depends on the F command. =cut pretoc '2:Library Types' debug ' Inside ESS module, getting client library types' var $cnt = 0 loop $dir (catDir($EPM_HOME,'products','Essbase','EssbaseClient','bin'),\ catDir($EPM_HOME,'products','Essbase','EssbaseClient-32','bin')) {if testDir('d',$dir) {report concat('clnlibtyp',incr($cnt)) var $dir = catDir($CLIENT_DIR,'bin') if isUnix() {prefix {write '---+!! Client Shared Library Types' write '---## From ',$dir write '|*File*|*Type*|*Modified*|*Size*|*Mode*|' } var $pat = check(getOsName(),'aix','\.(a|so)$','\.(sl|so)$') loop $fil (grepDir($dir,$pat,'p')) {var ($lin) = command(concat('file ',$fil)) var ($fil,$ver) = split('\:\s+',$lin,2) write '|',basename($fil),' |',$ver,' |',\ getLastModify($fil,'%d-%b-%Y %H:%M:%S'),' | ',\ getSize($fil),'|',statFile($fil),' |' } } elsif or(isWindows(),isCygwin()) {prefix {write '---+!! Client Executable and Library Version Information' write $TOC } loop $fil (grepDir($dir,'\.(dll|exe)$','ip')) {write '---+ Version Information from ',basename($fil) call statFile('p',$fil) write '%BR%' var $inf = getVersionInfo($fil) loop $key (keys($inf)) write '|*',replace($key,'\012',' ',true),' *|',\ replace($inf->{$key},'\012','%BR%',true),' |' write $TOP } } if isCreated(true) toc '3:[[',getFile(),'][rda_report][',\ encode(replace($dir,$EPM_HOME,'$EPM_HOME')),']]' } } unpretoc =head2 diskspace - Disk Space Collects free space on the Oracle Essbase database volume. =cut debug ' Inside ESS module, getting diskspace' report diskspace prefix write '---+!! Disk Free on Hyperion Home Volume' if or(isUnix(),isCygwin()) {if grepCommand(concat('df -k ',quote($EPM_HOME,'x')),'\s\d+%\s','f') {var ($val) = match(last,'^.*\s(\d+)\s+\d+%\s') var $val = int(expr('/',$val,1024)) write '|*Free Disk Space (in MiB)*| ',$val,'|' } } else {if grepCommand(concat('dir "',$EPM_HOME,'"'),' bytes free\s*$','f') {var $val = replace(field('\s+',2,last),',','',true) var $val = int(expr('/',$val,1048576)) write '|*Free Disk Space (in MiB)*| ',$val,'|' } } if isCreated(true) {write $TOP toc '2:[[',getFile(),'][rda_report][Disk Space]]' } =head2 Other Log Files Collects other log files. =cut pretoc '2:Other Log Files' debug ' Inside ESS module, getting other log files' var $opt = concat('irm',$AGE) call sort_files(3,$TAIL,grepDir(catDir($EPM_HOME,'logs'),'\.log$',$opt)) unpretoc =head1 DEPLOYMENT REPORTS Available on version 11.1.2 and later. =cut loop $uid (split('\|',$ESS_REQUESTS)) {next !$uid var $ins = getSetting(concat('ESS_HOME',$uid)) pretoc '%SPLIT%' pretoc "1+:'",getSetting(concat('ESS_INSTANCE',$uid)),"' Deployment" var $ARBORPATH = getSetting(concat('ESS_ARBORPATH',$uid)) var $HOST = getSetting(concat('ESS_HOST',$uid),'LOCAL') var $USERID = getSetting(concat('ESS_USER',$uid)) var $APPNAME = getSetting(concat('ESS_APPNAME',$uid)) var $DBNAME = getSetting(concat('ESS_DBNAME',$uid)) call setAbbr(concat('ESS_i',$uid)) =head2 env - Environment Variables Collects environment variables. =cut debug ' Inside ESS module, getting environment variables' report env prefix {write '---+!! Essbase Environment Variables' write '|*Variable*|*Environment*|*',${AS.BAT:'setEssbaseEnv'},'*|' } var (@env,%env) = () if isUnix() var $pat = '^\w+\=' else var $pat = '^set\s+\w+\=' loop $lin (grepFile(catFile($ARBORPATH,'bin',${AS.BAT:'setEssbaseEnv'}),\ $pat)) {if isUnix() var $key = key($lin) else var $key = field('\s+',1,key($lin)) if missing($env{$key}) call push(@env,$key) var $env{$key} = value($lin) } loop $key ('ARBORPATH',\ 'EPM_ORACLE_HOME',\ 'ESSLANG',\ 'PATH',\ 'ESSBASE_PATH',\ 'DOMAIN_HOME',\ @{CUR.SHLIB}) {if missing($env{$key}) var $env{$key} = undef } loop $key (keys(%env)) write '|',$key,'|',replace(getEnv($key),${RDA.SEPARATOR},'%BR%',true),' |',\ replace($env{$key},${RDA.SEPARATOR},'%BR%',true),' |' if isCreated(true) toc '2:[[',getFile(),'][rda_report][Environment Variables]]' =head2 config - Configuration Parameters Collects Oracle Essbase configuration parameters from F<$ARBORPATH/bin/essbase.cfg> file. =cut if testFile('r',catFile($ARBORPATH,'bin','essbase.cfg')) {debug ' Inside ESS module, getting configuration parameters' report config var ($fil,%tbl) = (lastFile()) prefix {write '---+!! Configuration Parameters' write '---## Information Taken from ',$fil write '|*Parameter*|*Value*|' } loop $lin (grepFile($fil,'^[A-Za-z]+\s+\S')) var $tbl{lc($lin)} = replace($lin,'\s+',' |') loop $key (keys(%tbl)) write '|',$tbl{$key},' |' if isCreated(true) toc '2:[[',getFile(),'][rda_report][Configuration Parameters]]' } =head2 startup - Startup Script Collects Oracle Essbase startup script. =cut debug ' Inside ESS module, getting startup script' var ($fil) = grepDir(catDir($ARBORPATH,'bin'),'^startEssbase\.(sh|bat)$','p') if testFile('r',$fil) {report startup prefix {write '---+!! Startup Script' write '---## Information Taken from ',$fil } call writeFile($fil) if isCreated(true) toc '2:[[',getFile(),'][rda_report][Startup Script]]' } =head2 dbinfo - Essbase Database Information Collects Oracle Essbase database information. For batch/cron execution, you can encode the password in the setup file using the pseudo user C. =cut debug ' Inside ESS module, getting Essbase database information' if getSetting('SQL_PASSWORD_ESSBASE_USER') var ($pwd) = unpack('u',last) else var $pwd = askPassword('Enter password for Oracle Essbase: ') var $out = getTemp('out') var $cmd = catFile(catDir($ARBORPATH,'bin'),${AS.BAT:'startEsscmd'}) var $ARBORBIN = lastDir() if testFile('fx',$cmd) {if isUnix() {var $job = quote(createTemp('ESS','.bat',true),'x') call writeTemp('ESS','cd "',$ARBORBIN,'"') call writeTemp('ESS',lastCommand(),' >',quote($out,'x')) call closeTemp('ESS') output | $job write 'LOGIN "',join('" "',$HOST,$USERID,$pwd),'";' if $APPNAME {write 'GETAPPINFO "',$APPNAME,'";' write 'GETAPPSTATE "',$APPNAME,'";' } else {write 'GETAPPINFO;' write 'GETAPPSTATE;' } if and($APPNAME,$DBNAME) {write 'GETDBINFO "',$APPNAME,'" "',$DBNAME,'";' write 'GETDBSTATE "',$APPNAME,'" "',$DBNAME,'";' } else {write 'GETDBINFO;' write 'GETDBSTATE;' } if and($APPNAME,$DBNAME) {write 'GETDBSTATS;' write $APPNAME write $DBNAME } write 'EXIT;' close report dbinfo prefix write '---+!! Essbase Database Information' call writeFile($out) call unlinkTemp('ESS') call unlinkTemp('out') } elsif or(isWindows(),isCygwin()) {var $cmd = lastCommand() var $tmp = createTemp('job','.SCR',true) call writeTemp('job','LOGIN "',join('" "',$HOST,$USERID,$pwd),'";') if $APPNAME {call writeTemp('job','GETAPPINFO "',$APPNAME,'";') call writeTemp('job','GETAPPSTATE "',$APPNAME,'";') } else {call writeTemp('job','GETAPPINFO;') call writeTemp('job','GETAPPSTATE;') } if and($APPNAME,$DBNAME) {call writeTemp('job','GETDBINFO "',$APPNAME,'" "',$DBNAME,'";') call writeTemp('job','GETDBSTATE "',$APPNAME,'" "',$DBNAME,'";') } else {call writeTemp('job','GETDBINFO;') call writeTemp('job','GETDBSTATE;') } if and($APPNAME,$DBNAME) call writeTemp('job','GETDBSTATS "',$APPNAME,'" "',$DBNAME,'";') call writeTemp('job','EXIT;') call closeTemp('job') report dbinfo prefix write '---+!! Essbase Database Information' call writeCommand(concat('cd ',quote($ARBORBIN,'x'),' & ',$cmd,' ',\ quote($tmp,'x'))) call unlinkTemp('job') } if isCreated(true) toc '2:[[',getFile(),'][rda_report][Essbase Database Information]]' } =head2 secfile - Security File Exports the security file. =cut debug ' Inside ESS module, getting Security File' var $cmd = catFile($ARBORPATH,'bin',${AS.BAT:'startMaxl'}) if testFile('fx',$cmd) {var $sec = getTemp('sec') if isUnix() {var $job = quote(createTemp('ESS','.bat',true),'x') call writeTemp('ESS','cd "',$ARBORBIN,'"') call writeTemp('ESS',lastCommand()) call closeTemp('ESS') output | $job write 'LOGIN "',join('" "',$USERID,$pwd),'";' write 'Export security_file to data_file "',$sec,'";' write 'Exit;' report secfile prefix write '---+!! Essbase Security File' call writeFile($sec) call unlinkTemp('ESS') call unlinkTemp('sec') } elsif or(isWindows(),isCygwin()) {var $cmd = lastCommand() var $tmp = createTemp('job','.SCR',true) call writeTemp('job','LOGIN "',join('" "',$USERID,$pwd),'";') call writeTemp('job',"Export security_file to data_file '",$sec,"';") call writeTemp('job','Exit;') call closeTemp('job') report secfile prefix write '---+!! Essbase Security File' call loadCommand(concat('cd ',quote($ARBORBIN,'x'),' & ',$cmd,' ',\ quote($tmp,'x'))) call writeFile($sec) call unlinkTemp('job') } if isCreated(true) toc '2:[[',getFile(),'][rda_report][Security File]]' } =head2 otl_files - Essbase Outline Files Collects the Essbase outline files from F<$INSTANCE_HOME/diagnostics/EssbaseServer/essbaseserver1/app> directory. =cut report otl_files var $app = catDir($ins,'EssbaseServer','essbaseserver1','app') prefix {write '---+!! Essbase Outline Files' write '---## From: ',$app write ' * Links point to files that have been collected in their original \ format. Opening them directly in your browser can present \ 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*| *Size*|*Last Modified Date*|' } loop $fil (grepDir($app,'\.otl$','dr',2)) {var $lnk = encode($fil) var $siz = getSize($fil) if $siz {call $[OUT]->add_report('d',concat('O_',basename($fil,'.otl')),0,'.otl') if ${CUR.LAST}->write_data($fil) var $lnk = concat('[[',${CUR.LAST}->get_file,'][_blank][',$lnk,']]') end ${CUR.LAST} } write '|',$lnk,' | ',$siz,'|',\ getLastModify($fil,'%d-%b-%Y %H:%M:%S'),' |' } if isCreated(true) toc '2:[[',getFile(),'][rda_report][Essbase Outline Files]]' =head2 diaglogs - Diagnostic Log Files Collects the diagnostic log files from F<$INSTANCE_HOME/diagnostics/logs/essbase> directory. =cut report diaglogs var $log = catDir($ins,'diagnostics','logs') prefix {write '---+!! Diagnostic Log Files' write '---## From: ',$log write ' * Last ',$TAIL,' lines from the log files captured' write ' * Links point to files that have been collected in their original \ format. Opening them directly in your browser can present \ 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*| *Size*|*Last Modified Date*|' } loop $sub ('essbase','EssbaseStudio') {loop $fil (grepDir(catDir($log,$sub),'\.(log|xcp)$','irt')) {if $buf = new('Buffer','r',$fil) {var $lnk = encode($fil) var $siz = getSize($fil) if $siz {output d,concat('L_',basename($fil)) if ${CUR.LAST}->write_tail($buf,$TAIL,['F',$fil,'F','T']) var $lnk = concat('[[',${CUR.LAST}->get_file,'][_blank][',$lnk,']]') end ${CUR.LAST} } write '|',$lnk,' | ',$siz,'|',\ getLastModify($fil,'%d-%b-%Y %H:%M:%S'),' |' } } } if isCreated(true) toc '2:[[',getFile(),'][rda_report][Diagnostic Log Files]]' =head2 Oracle WebLogic Server Information Includes the Oracle WebLogic reports generated by the WREQ module for the associated Oracle WebLogic Server domain. =cut if ?getSetting(concat('ESS_DOM',$uid,'_REQ_DOMAIN')) {var $dom = basename(last) toc '%PUSH("%SPLIT%")%' toc '%PUSH("1++:Oracle WebLogic Server Overview")%' toc '%INCLUDE("',${CUR.GROUP},'_WREQ_ESS_TOP',$uid,'.toc",1)%' toc '%POP2%' toc '%PUSH("%SPLIT%")%' toc '%PUSH("1++:',"'",$dom,"'",' Domain")%' toc '%INCLUDE("',${CUR.GROUP},'_WREQ_ESS_DOM',$uid,'.toc",1)%' toc '%POP2%' } unpretoc 2 } } =head1 PRODUCT REPORTS Collects the following reports on versions earlier than 11.1.2 =cut else {var $ARBORPATH = getSetting('ESS_ARBORPATH',getEnv('ARBORPATH','')) var $HOST = getSetting('ESS_HOST','LOCAL') var $USERID = getSetting('ESS_USER') var $APPNAME = getSetting('ESS_APPNAME') var $DBNAME = getSetting('ESS_DBNAME') # Adjust directories if $EPM_HOME var $EPM_HOME = catDir($EPM_HOME) if $ARBORPATH var $ARBORPATH = catDir($ARBORPATH) if testDir('d',catDir($ARBORPATH,upDir(),'EssbaseServer')) {var $SERVER_DIR = lastDir() if testDir('d',catDir($ARBORPATH,upDir(),'EssbaseClient')) var $CLIENT_DIR = lastDir() } elsif testDir('d',catDir($ARBORPATH,upDir(),'EssbaseClient')) var $CLIENT_DIR = lastDir() else var $SERVER_DIR = $ARBORPATH =head2 env - Environment Variables Collects environment variables. =cut debug ' Inside ESS module, getting environment variables' report env prefix {write '---+!! Essbase Environment Variables' write '|*Variable*|*Environment*|*hyperionenv.doc*|' } var (@env,%env) = () loop $lin (grepFile(catFile($ARBORPATH,'hyperionenv.doc'),'^\w+\=')) {var $key = key($lin) if missing($env{$key}) call push(@env,$key) var $env{$key} = value($lin) } loop $key ('ARBORPATH',\ 'HYPERION_HOME',\ 'ESSLANG',\ 'PATH',\ @{CUR.SHLIB}) {if missing($env{$key}) var $env{$key} = undef } loop $key (keys(%env)) write '|',$key,'|',replace(getEnv($key),${RDA.SEPARATOR},'%BR%',true),' |',\ replace($env{$key},${RDA.SEPARATOR},'%BR%',true),' |' if isCreated(true) toc '2:[[',getFile(),'][rda_report][Environment Variables]]' =head2 config - Configuration Parameters Collects Oracle Essbase configuration parameters from F<$ARBORPATH/bin/essbase.cfg> file or F file. =cut if testDir('d',$ARBORPATH) {if testFile('r',catFile($SERVER_DIR,'bin','essbase.cfg')) {debug ' Inside ESS module, getting configuration parameters' report config var ($fil,%tbl) = (lastFile()) prefix {write '---+!! Configuration Parameters' write '---## Information Taken from ',$fil write '|*Parameter*|*Value*|' } loop $lin (grepFile($fil,'^[A-Za-z]+\s+\S')) var $tbl{lc($lin)} = replace($lin,'\s+',' |') loop $key (keys(%tbl)) write '|',$tbl{$key},' |' if isCreated(true) toc '2:[[',getFile(),'][rda_report][Configuration Parameters]]' } =head2 startup - Startup Script Collects Oracle Essbase startup script. =cut debug ' Inside ESS module, getting startup script' var ($fil) = grepDir(catDir($SERVER_DIR,'bin'),\ '^startEssbase\.(sh|bat)$','p') if testFile('r',$fil) {report startup prefix {write '---+!! Startup Script' write '---## Information Taken from ',$fil } call writeFile($fil) if isCreated(true) toc '2:[[',getFile(),'][rda_report][Startup Script]]' } =head2 libtyp - Library Types Collects library file types from the F or F directory. For UNIX, the collection depends on the F command. =cut if $SERVER_DIR {debug ' Inside ESS module, getting library types' report libtyp var $dir = catDir($SERVER_DIR,'bin') if isUnix() {prefix {write '---+!! Shared Library Types' write '---## From ',$dir write '|*File*|*Type*|*Modified*|*Size*|*Mode*|' } var $pat = check(getOsName(),'aix','\.(a|so)$','\.(sl|so)$') loop $fil (grepDir($dir,$pat,'p')) {var ($lin) = command(concat('file ',$fil)) var @sta = getStat($fil) var ($fil,$ver) = split('\:\s+',$lin,2) write '|',basename($fil),' |',$ver,' |',\ getLastModify($fil,'%d-%b-%Y %H:%M:%S'),' | ',\ getSize($fil),'|',fmt_mode($sta[2]),' |' } } elsif or(isWindows(),isCygwin()) {prefix {write '---+!! Executable and Library Version Information' write $TOC } loop $fil (grepDir($dir,'\.(dll|exe)$','ip')) {write '---+ Version Information from ',basename($fil) call statFile('p',$fil) write '%BR%' var $inf = getVersionInfo($fil) loop $key (keys($inf)) write '|*',replace($key,'\012',' ',true),' *|',\ replace($inf->{$key},'\012','%BR%',true),' |' write $TOP } } if isCreated(true) toc '2:[[',getFile(),'][rda_report][Library Types]]' } =head2 clnlibtyp - Client Library Types Collects library file types from the F directory. For UNIX, the collection depends on the F command. =cut if $CLIENT_DIR {debug ' Inside ESS module, getting library types' report clnlibtyp var $dir = catDir($CLIENT_DIR,'bin') if isUnix() {prefix {write '---+!! Client Shared Library Types' write '---## From ',$dir write '|*File*|*Type*|*Modified*|*Size*|*Mode*|' } var $pat = check(getOsName(),'aix','\.(a|so)$','\.(sl|so)$') loop $fil (grepDir($dir,$pat,'p')) {var ($lin) = command(concat('file ',$fil)) var ($fil,$ver) = split('\:\s+',$lin,2) write '|',basename($fil),' |',$ver,' |',\ getLastModify($fil,'%d-%b-%Y %H:%M:%S'),' | ',\ getSize($fil),'|',statFile($fil),' |' } } elsif or(isWindows(),isCygwin()) {prefix {write '---+!! Client Executable and Library Version Information' write $TOC } loop $fil (grepDir($dir,'\.(dll|exe)$','ip')) {write '---+ Version Information from ',basename($fil) call statFile('p',$fil) write '%BR%' var $inf = getVersionInfo($fil) loop $key (keys($inf)) write '|*',replace($key,'\012',' ',true),' *|',\ replace($inf->{$key},'\012','%BR%',true),' |' write $TOP } } if isCreated(true) toc '2:[[',getFile(),'][rda_report][Client Library Types]]' } # Set the enviroment variables for getting the database information var ($slk,%old) = (${CUR.SHLIB}) loop $key (@env) {next compare('eq',$key,'ESSLANG') if ?$env{$key} var $old{$key} = setEnv($key,replaceEnv($env{$key}),true) } if and($slk,missing($old{$slk})) var $old{$slk} = setEnv($slk,\ join(${RDA.SEPARATOR},catDir($SERVER_DIR,'bin'),getEnv($slk,undef,true))) if missing($old{'ARBORPATH'}) var $old{'ARBORPATH'} = setEnv('ARBORPATH',$SERVER_DIR) if missing($old{'ESSBASEPATH'}) var $old{'ESSBASEPATH'} = setEnv('ESSBASEPATH',$SERVER_DIR) var $old{'ESSLANG'} = setEnv('ESSLANG','English_UnitedStates.UTF-8@Binary') =head2 dbinfo - Essbase Database Information Collects Oracle Essbase database information. For batch/cron execution, you can encode the password in the setup file using the pseudo user C. =cut debug ' Inside ESS module, getting Essbase database information' if getSetting('SQL_PASSWORD_ESSBASE_USER') var ($pwd) = unpack('u',last) else var $pwd = askPassword('Enter password for Oracle Essbase: ') var $out = getTemp('out') var $out = getTemp('out') var $cmd = catFile($SERVER_DIR,'bin',cond(isUnix(),'ESSCMD','ESSCMD.exe')) if testFile('fx',$cmd) {if isUnix() {output | concat(lastCommand(),' > ',quote($out,'x')) write 'LOGIN "',join('" "',$HOST,$USERID,$pwd),'";' if $APPNAME {write 'GETAPPINFO "',$APPNAME,'";' write 'GETAPPSTATE "',$APPNAME,'";' } else {write 'GETAPPINFO;' write 'GETAPPSTATE;' } if and($APPNAME,$DBNAME) {write 'GETDBINFO "',$APPNAME,'" "',$DBNAME,'";' write 'GETDBSTATE "',$APPNAME,'" "',$DBNAME,'";' } else {write 'GETDBINFO;' write 'GETDBSTATE;' } if and($APPNAME,$DBNAME) {write 'GETDBSTATS;' write $APPNAME write $DBNAME } write 'EXIT;' close report dbinfo prefix {write '---+!! Essbase Database Information' write ' * Environment variables have been set as following for getting \ the database information' loop $key (keys(%old)) write ' * ',$key,' set to ',getEnv($key,undef,true) } call writeFile($out) call unlinkTemp('out') } elsif or(isWindows(),isCygwin()) {var $cmd = lastCommand() var $tmp = createTemp('job','.SCR',true) call writeTemp('job','LOGIN "',join('" "',$HOST,$USERID,$pwd),'";') if $APPNAME {call writeTemp('job','GETAPPINFO "',$APPNAME,'";') call writeTemp('job','GETAPPSTATE "',$APPNAME,'";') } else {call writeTemp('job','GETAPPINFO;') call writeTemp('job','GETAPPSTATE;') } if and($APPNAME,$DBNAME) {call writeTemp('job','GETDBINFO "',$APPNAME,'" "',$DBNAME,'";') call writeTemp('job','GETDBSTATE "',$APPNAME,'" "',$DBNAME,'";') } else {call writeTemp('job','GETDBINFO;') call writeTemp('job','GETDBSTATE;') } if and($APPNAME,$DBNAME) call writeTemp('job','GETDBSTATS "',$APPNAME,'" "',$DBNAME,'";') call writeTemp('job','EXIT;') call closeTemp('job') report dbinfo prefix {write '---+!! Essbase Database Information' write ' * Environment variables have been set as following for getting \ the database information' loop $key (keys(%old)) write ' * ',$key,' set to ',getEnv($key,undef,true) } call writeCommand(concat($cmd,' ',quote($tmp,'x'))) call unlinkTemp('job') } if isCreated(true) toc '2:[[',getFile(),'][rda_report][Essbase Database Information]]' } =head2 secfile - Security File Exports the security file. =cut debug ' Inside ESS module, getting Security File' var $cmd = catFile($SERVER_DIR,'bin',cond(isUnix(),'essmsh','essmsh.exe')) if testFile('fx',$cmd) {var $sec = getTemp('sec') if isUnix() {output | lastCommand() write 'LOGIN "',join('" "',$USERID,$pwd),'";' write 'Export security_file to data_file "',$sec,'";' write 'Exit;' report secfile prefix {write '---+!! Essbase Security File' write ' * Environment variables have been set as following for getting \ the security file' loop $key (keys(%old)) write ' * ',$key,' set to ',getEnv($key,undef,true) } call writeFile($sec) call unlinkTemp('sec') } elsif or(isWindows(),isCygwin()) {var $cmd = lastCommand() var $tmp = createTemp('job','.SCR',true) call writeTemp('job','LOGIN "',join('" "',$USERID,$pwd),'";') call writeTemp('job',"Export security_file to data_file '",$sec,"';") call writeTemp('job','Exit;') call closeTemp('job') report secfile prefix {write '---+!! Essbase Security File' write ' * Environment variables have been set as following for getting \ the security file' loop $key (keys(%old)) write ' * ',$key,' set to ',getEnv($key,undef,true) } call loadCommand(concat($cmd,' ',quote($tmp,'x'))) call writeFile($sec) call unlinkTemp('job') } if isCreated(true) toc '2:[[',getFile(),'][rda_report][Security File]]' } # Restore the initial environment loop $key (keys(%old)) call setEnv($key,$old{$key},true) } =head2 diskspace - Disk Space Collects free space on the Oracle Essbase database volume. =cut debug ' Inside ESS module, getting diskspace' report diskspace prefix write '---+!! Disk Free on Hyperion Home Volume' if or(isUnix(),isCygwin()) {if grepCommand(concat('df -k ',quote($EPM_HOME,'x')),'\s\d+%\s','f') {var ($val) = match(last,'^.*\s(\d+)\s+\d+%\s') var $val = int(expr('/',$val,1024)) write '|*Free Disk Space (in MiB)*| ',$val,'|' } } else {if grepCommand(concat('dir "',$EPM_HOME,'"'),' bytes free\s*$','f') {var $val = replace(field('\s+',2,last),',','',true) var $val = int(expr('/',$val,1048576)) write '|*Free Disk Space (in MiB)*| ',$val,'|' } } if isCreated(true) {write $TOP toc '2:[[',getFile(),'][rda_report][Disk Space]]' } =head2 applog - Application Log Collects F<$EPM_HOME/AnalyticServices/app/appname/appname.log> file. =cut if $APPNAME {debug ' Inside ESS module, gathering application log file' report applog call tail_file(catDir($EPM_HOME,'AnalyticServices','app',$APPNAME),\ concat($APPNAME,'.log'),$TAIL) if isCreated() toc '2:[[',getFile(),'][rda_report][Application Log]]' } =head2 Other Log Files Collects other log files. =cut pretoc '2:Other Log Files' debug ' Inside ESS module, getting other log files' var $opt = concat('irm',$AGE) call sort_files(3,$TAIL,grepDir(catDir($EPM_HOME,'logs'),'\.log$',$opt),\ grepDir(catDir($ARBORPATH),'Essbase.log$',$opt)) unpretoc =head2 Oracle WebLogic Server Information Includes the Oracle WebLogic Server reports generated by the WREQ module for the associated Oracle WebLogic Server domain (on versions having a product registry). =cut if ?${ESS_DOM_REQ_DOMAIN} {var $dom = basename(last) toc '%PUSH("%SPLIT%")%' toc '%PUSH("1+:Oracle WebLogic Server Overview")%' toc '%INCLUDE("',${CUR.GROUP},'_WREQ_ESS_TOP.toc")%' toc '%POP2%' toc '%PUSH("%SPLIT%")%' toc '%PUSH("1+:',"'",$dom,"'",' Domain")%' toc '%INCLUDE("',${CUR.GROUP},'_WREQ_ESS_DOM.toc")%' toc '%POP2%' } unpretoc } =begin credits =over 10 =item RDA 4.16: Satheesh Naraginti, Sudev Alampalli, Torben Hein. =item RDA 4.17: Nancy Dailey, Jack Zhang. =item RDA 4.19: Nancy Dailey. =item RDA 4.22: Nancy Dailey. =item RDA 4.23: Nancy Dailey. =item RDA 4.24: Maurice Bahuhan, Nancy Dailey. =item RDA 4.28: Chethan Kopparam. =item RDA 4.28: Nancy Dailey. =back =end credits =head1 COPYRIGHT NOTICE Copyright (c) 2002, 2012, 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