# S362OIM.def: Collects Oracle Identity Manager Information # $Id: S362OIM.def,v 1.8 2008/02/25 17:32:55 mschenke Exp $ # ARCS: $Header: /home/cvs/repository/RDA_4/src/scripting/lib/modules/S362OIM.def,v 1.8 2008/02/25 17:32:55 mschenke Exp $ # # Change History # 20080225 MSC Change the copyright notice. =head1 NAME S362OIM - Collects Oracle Identity Manager Information =head1 DESCRIPTION This module collects information about Oracle Identity Manager. The following reports can be generated and are regrouped in C: =cut echo tput('bold'),'Processing Oracle Identity Manager module ...',tput('off') # Initialization var $OIM_FIX = getSetting('OIM_FIX',true) var $OIM_NAM = getSetting('OIM_NAME','XIMDD') var $OIM_PRT = getSetting('OIM_PORT',8080) var $OIM_SRV = getSetting('OIM_SERVER') var $OIM_USR = uc(getSetting('OIM_USER','XELSYSADM')) var $ERR = ' (error)' var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' pretoc '1:Oracle Identity Manager' # Validate settings if !match($OIM_SRV,'^[\w\-\.]+$') {echo 'Invalid OIM diagnostic dashboard server' return } if !match($OIM_PRT,'^[0-9]+$') {echo 'Invalid OIM diagnostic dashboard port' return } if !match($OIM_NAM,'^\w+$') {echo 'Invalid diagnostic dashboard application name' return } # Get a session cookie var $url = concat('http://',$OIM_SRV,':',$OIM_PRT,'/',$OIM_NAM,\ '/SystemVerification') var $req = createRequest('GET',$url) var $rsp = submitRequest($req) if !isSuccess($rsp) {echo 'Cannot access the diagnostic dashboard (',join(',',getRspCode($rsp)),\ ' - ',getRspMessage($rsp),')' return } =head2 sys_info - System Information Collects Oracle Identity Manager system information. =cut # Extract the system information from previous response var $htm = htmlLoadResponse($rsp,\ htmlFilter(htmlDisable(htmlParser(),'DR'),'td')) loop $nod (htmlFind($htm,'.../td class="ControlLabel"')) {loop $itm (htmlContent($nod,'S')) {var $str = htmlText($itm) next !match($str,'\w+') var $sys = replace($str,'\240',' ',true) } } # Parse the system information if $sys {debug ' Inside OIM module, getting OIM system information' report sys_info loop $val (split('\s{2,}',$sys)) {next match($val,'(\<|The following diagnostic)',true) if match($val,'^System Information\s*:',true) write '---+ System Information' elsif match($val,'^(.*):$') write '|',last,' ||' elsif match($val,'^(.*):\s+(.*)$') {var ($hdr,$txt) = (last) write '|*',$hdr,'* |',$txt,' |' } } if isCreated(true) toc '2:[[',getFile(),'][rda_report][System Information]]' } =head2 db_connect - Database Connectivity Check This test is to verify if Oracle Identity Manager is able to connect to the database or not. This test verifies the direct database connection as well as the J2EE data sources (XA and non-XA). =head2 lock_status - Account Lock Status This test is to verify if Oracle Identity Manager locks an account when there are successive multiple invalid login attempts. This test checks if a given account is locked or not. =head2 enc_key_ver - Data Encryption Key Verification This test is to verify the Data Encryption Key used for Oracle Identity Manager. The data encryption key in an Oracle Identity Manager installation should be the same as the one used to encrypt the data in the Oracle Identity Manager database. This may not be the case when an Oracle Identity Manager installation is pointed to a database schema created for a different Oracle Identity Manager installation. This can also happen when database dump from one Oracle Identity Manager installation is imported for a different Oracle Identity Manager installation without copying the corresponding key. =head2 sch_svc_sta - Scheduler Service Status This test is to verify the status of the Oracle Identity Manager Scheduler Service running on this server. =head2 rem_mgr_sta - Remote Manager Status This test reports the status of the Remote Managers that this Oracle Identity Manager installation is set up to work with. =head2 jms_msg - JMS Messaging Verification The purpose of this test is to verify that Oracle Identity Manager will be able to submit a JMS message and process it. =head2 jvm_prop - Java VM System Properties Report This test is to display all the Java VM system properties. =head2 lib_version - Libraries and Extensions Version Report This test reports the version of the Oracle Identity Manager libraries and extensions. =head2 lib_manifest - Libraries and Extensions Manifest Report This test reports the manifest information of the Oracle Identity Manager libraries and extensions. =head2 sso_diag - SSO Diagnostic Information This test provides information pertaining to SSO setup. Also, provides instructions required to set up Oracle Identity Manager to enable retrieving run-time diagnostic information related to SSO logins. =cut var %tb_rpt = (\ 'Database Connectivity Check',\ 'db_connect',\ 'Account Lock Status',\ 'lock_status',\ 'Data Encryption Key Verification',\ 'enc_key_ver',\ 'Scheduler Service Status',\ 'sch_svc_sta',\ 'Remote Manager Status',\ 'rem_mgr_sta',\ 'JMS Messaging Verification',\ 'jms_msg',\ 'Java VM System Properties',\ 'jvm_prop',\ 'Oracle Identity Manager Libraries and Extensions Version Report',\ 'lib_version',\ 'Oracle Identity Manager Libraries and Extensions Manifest Report',\ 'lib_manifest',\ 'SSO Diagnostic Information',\ 'sso_diag'\ ) # Submit query (POST request with session cookie) debug ' Inside OIM module, executing tests' var $req = createRequest('POST',$url) call addReqForm($req,\ 'CB_VALIDATEDBCONNECTIONS=selected',\ 'CB_VALIDATEUSERLOCKED=selected',\ concat('INP_VALIDATEUSERLOCKED_USERNAME=',encode($OIM_USR)),\ 'CB_VALIDATEDBKEY=selected',\ 'CB_VALIDATESCHEDULER=selected',\ 'CB_VALIDATEREMOTEMANAGER=selected',\ 'CB_VALIDATEMESSAGE=selected',\ 'CB_SYSTEMPROPERTIESCHECK=selected',\ 'CB_REPORTLIBRARIESVERSION=selected',\ 'CB_REPORTLIBRARIESMANIFEST=selected',\ 'CB_SSODIAGNOSTICINFO=selected',\ 'Verify=Verify') var $rsp = submitRequest($req) if !isSuccess($rsp) {echo 'Failed to get test results from the OIM diagnostic dashboard' return } data "diag.htm" call writeResponse($rsp) var $htm = htmlLoadResponse($rsp,\ htmlFilter(htmlDisable(htmlFix(htmlParser(),\ $OIM_FIX),\ 'DR'),\ 'td','a','b','pre')) # Declare a macro for formatting a PRE block macro fmt_pre {var ($str) = @arg var $str = encode(replace($str,'\n','%BR%',true)) var $str = replace($str,'\t','  ',true) return $str } # Extract the HTML content and write to reports loop $nod (htmlFind($htm,'.../td class="ControlLabel"')) {var ($ttl,@nod) = htmlContent($nod) # Validate that it is a test node next !compare('eq',htmlName($ttl),'a') var $ttl = htmlValue($ttl,'name') debug ' Inside OIM module, extracting ',$ttl # Parse the test information var ($key,%tst) = ('?') loop $itm (@nod) {var $tag = htmlName($itm) if !defined($tag) var $tst{$key} = trim(htmlText($itm),'\240+') elsif compare('eq',$tag,'b') var $key = lc(field('\s',0,htmlText($itm))) elsif compare('eq',$tag,'pre') var $tst{$key} = trim(htmlText($itm)) } # Generate the report report nvl($tb_rpt{$ttl},$ttl) write '---+!! ',$ttl write '|*Description*|',$tst{'description'},' |' if exists($tst{'input'}) write '|*Input Parameters*|``',fmt_pre($tst{'input'}),'`` |' write '|*Result*|',check(uc($tst{'result'}),'FAILED','%RED%','%BLUE%'),\ $tst{'result'},'%ENDCOLOR% |' if match($ttl,'properties report',true) {write '---++ Properties' write '|*Property*|*Value*|' loop $lin (split('\n',$tst{'details'})) {next match($lin,'^\s*$') write '|',join(' |',split('\s+',$lin,2)),' |' } } elsif match($ttl,'version report',true) {write '---++ Library Versions' write '|*Library Name*|*Version*|' loop $lin (split('\n',$tst{'details'})) {next match($lin,'^\s*(\z|LIBRARY)') write '|',join(' |',split('\s+',$lin,2)),' |' } } elsif match($ttl,'manifest report',true) {write '%BR%' write '%TOC3-2%' var $flg = false loop $lin (split('\n',$tst{'details'})) {next match($lin,'^\s*(\z|LIBRARY)') if match($lin,'^Name:') {if $flg write $TOP var $flg = true write '---++ ',replace($lin,'^Name:\s*') } elsif match($lin,'^\s+(\w[^:]+):\s+(.*)$') {var ($key,$val) = last write '|*',$key,'* |',$val,' |' } } } else write '|*Details*|``',fmt_pre($tst{'details'}),'``|' if isCreated(true) {write $TOP toc '2:[[',getFile(),'][rda_report][',\ replace($ttl,'Oracle Identity Manager '),\ check(uc($tst{'result'}),'FAILED',$ERR),']]' } } unpretoc =begin credits =over 10 =item RDA 4.10: Brad Donison. =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