# S335SES.def: Collects Oracle Secure Enterprise Search Information # $Id: S335SES.def,v 2.6 2012/01/03 13:34:45 mschenke Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_4/src/scripting/lib/modules/S335SES.def,v 2.6 2012/01/03 13:34:45 mschenke Exp $ # # Change History # 20120103 MSC Change the copyright notice. =head1 NAME S335SES - Collects Oracle Secure Enterprise Search Information =head1 DESCRIPTION This module collects Oracle Secure Enterprise Search-related information. The following reports can be generated and are regrouped under C: =cut echo tput('bold'),'Processing SES module ...',tput('off') # Initialisation var $CRAWLER_LOG = getSetting('SES_CRAWLER_LOG','') var $HOST = getSetting('SES_HOST') var $ORACLE_HOME = getSetting('ORACLE_HOME','') var $TAIL = getSetting('SES_TAIL',1000) var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' toc '1:Oracle Secure Enterprise Search' # Load the common macros run library() =head2 build - Build Information Collects build information when the F command is available. =cut if findCommand('unzip') {var $cmd = last report build debug ' Inside SES module, gathering build information' prefix write '---+!! Oracle Secure Enterprise Search Build Information' var $fil = catFile($ORACLE_HOME,'search','lib','search_query.jar') if testFile('r',$fil) call writeCommand(concat($cmd,' -p ',$fil,\ ' "oracle/search/query/buildinfo.properties"')) if isCreated(true) toc '2:[[',getFile(),'][rda_report][Build Information]]' } =head2 status - Status Collects Oracle Secure Enterprise Search status. It uses URLs for collecting information unless the C attribute is set to C in the F file. =cut report status debug ' Inside SES module, gathering searchctl status information' prefix {write '---+!! Status Information' write $TOC write '---+ Searchctl Status' write '---## Using: $ORACLE_HOME/bin/searchctl status' } call writeCommand(concat(catCommand($ORACLE_HOME,'bin','searchctl'),' status')) var $xml = xmlLoadFile(catFile($ORACLE_HOME,'oc4j','j2ee','OC4J_SEARCH',\ 'config','http-web-site.xml')) var ($obj) = xmlFind($xml,'.../web-site') var $prt = xmlValue($obj,'port') var $sec = xmlValue($obj,'secure') if !compare('eq',$sec,'true') {if isCreated(true) write $TOP else {write '---+!! Status Information' write $TOC } write '---+ Secure Enterprise Search Status' write '|*URL*|*Status*|*Message*|' # Use http://server:port/monitor/check.jsp var $url = concat('http://',$HOST,':',$prt,'/monitor/check.jsp') var $req = createRequest('GET',$url) debug ' Inside SES module, requesting ',$url var $rsp = submitRequest($req) if isSuccess($rsp) {var $htm = htmlLoadResponse($rsp,htmlDisable(htmlParser(),'R')) var @arr = htmlTable($htm) if grep(@arr,'Oracle Secure Enterprise Search instance is up') write '|',$url,' |Pass| |' else write '|',$url,' |Fail|',join('%BR%',@arr),' |' } else write '|',$url,' |Fail|',\ join(',',getRspCode($rsp)),' - ',getRspMessage($rsp),' |' # Use http://server:port/search/admin/index.jsp var $url = concat('http://',$HOST,':',$prt,'/search/admin/index.jsp') debug ' Inside SES module, requesting ',$url var $req = createRequest('GET',$url) var $rsp = submitRequest($req) if isSuccess($rsp) write '|',$url,' |Pass| |' else write '|',$url,' |Fail|',\ join(',',getRspCode($rsp)),' - ',getRspMessage($rsp),' |' # Use http://server:port/search/query/search var $url = concat('http://',$HOST,':',$prt,'/search/query/search') debug ' Inside SES module, requesting ',$url var $req = createRequest('GET',$url) var $rsp = submitRequest($req) if isSuccess($rsp) write '|',$url,' |Pass| |' else write '|',$url,' |Fail|',\ join(',',getRspCode($rsp)),' - ',getRspMessage($rsp),' |' write $TOP } if isCreated(true) toc '2:[[',getFile(),'][rda_report][Status]]' =head2 plugins - Plugins Lists plug-ins from the F<$ORACLE_HOME/search/lib/plugins> directory. =cut report plugins var $dir = catDir($ORACLE_HOME,'search','lib','plugins') debug ' Inside SES module, gathering plugins information' prefix {write '---+!! Contents of plugins Directory' write '---## Information Taken from ',encode($dir) write $TOC } loop $fil ($dir,grepDir($dir,'^\.+$','drv')) {if testDir('d',$fil) {write '---++ Contents of ',encode($fil) call statDir('an',$fil) write $TOP } } if isCreated(true) toc '2:[[',getFile(),'][rda_report][Plugins]]' =head2 Configuration Files Collects configuration files. =cut pretoc '2:Configuration Files' debug ' Inside SES module, gathering configuration files' call sort_files(3,0,\ catFile($ORACLE_HOME,'search','webapp','config','search.properties'),\ catFile($ORACLE_HOME,'search','config','searchctl.conf'),\ catFile($ORACLE_HOME,'search','data','config','crawler.dat'),\ catFile($ORACLE_HOME,'oc4j','j2ee','OC4J_SEARCH','config',\ 'http-web-site.xml')) =head2 Log Files Collects log files. =cut pretoc '2:Log Files' debug ' Inside SES module, gathering log files' call sort_files(3,$TAIL,\ catFile($ORACLE_HOME,'oc4j','j2ee','OC4J_SEARCH','log','oc4j.log'),\ grepDir($CRAWLER_LOG,'^i1ds.*\.log$','p')) =head1 SEE ALSO L =begin credits =over 10 =item RDA 4.17: Sitaramanjaneyulu Kondabolu. =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