# S440EM.def: Collects Enterprise Manager OMS and Repository Information # $Id: S440EM.def,v 1.9 2008/02/25 17:32:56 mschenke Exp $ # ARCS: $Header: /home/cvs/repository/RDA_4/src/scripting/lib/modules/S440EM.def,v 1.9 2008/02/25 17:32:56 mschenke Exp $ # # Change History # 20080225 MSC Change the copyright notice. =head1 NAME S440EM - Collects Oracle Enterprise Manager OMS and Repository Information =head1 DESCRIPTION This module collects Oracle Enterprise Manager OMS and Repository-related information. Some reports require that you install the EMDIAG kit. The following reports can be generated and are regrouped under C: =cut echo tput('bold'),'Processing EM module ...',tput('off') # Initialization var $AUDIT_AGE = getSetting('EM_AUDIT_AGE',30) var $INSTANCE_HOME = getSetting('EM_INSTANCE_HOME') var $ORACLE_HOME = getSetting('ORACLE_HOME') var $PING_TEST = getSetting('EM_PING_TEST') var $TAIL = getSetting('RDA_TAIL',1000) var $VIOLATION_AGE = getSetting('EM_VIOLATION_AGE',15) var $EMCTL = catFile($ORACLE_HOME,'bin',cond(isWindows(),'emctl.bat','emctl')) var $IS11G = defined($INSTANCE_HOME) var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' var $ERR = ' (error)' var $OH = quote($ORACLE_HOME) var $OH1 = concat('^',$OH,'\b') toc '1:Enterprise Manager Server' # Validate the ages if !isNumber($AUDIT_AGE) var $AUDIT_AGE = 30 if !isNumber($VIOLATION_AGE) var $VIOLATION_AGE = 15 # Load the common macros run library() run EMdiag() # Determine the user password var $log = nvl(get_em_login($IS11G,$ORACLE_HOME),'sysman') var $sid = get_em_conn($IS11G,$ORACLE_HOME) if hasSqlPassword($log,$sid) var $pwd = undef elsif getSetting('SQL_PASSWORD_EM_REPOS_USER') var ($pwd) = unpack('u',last) else var $pwd = askPassword(concat('Enter ',join('@',$log,$sid),' user password:')) # Change the current user var $old = setSqlLogin($log,$pwd,$sid) var $try = setSqlFailure(0) =head2 no_access - No Repository Access Indicates whether the Oracle Enterprise Manager repository is not accessible. =head2 not_found - No EMDIAG Kit Indicates whether the EMDIAG kit is not found. =head2 diagkit - EMDIAG Kit Information Displays the information collected by the EMDIAG kit. It generates this report only when the EMDIAG kit is installed in the Enterprise Manager repository. To trigger EMDIAG kit collections, use C before running this module. =head2 violations - Violation List Collects the diagnostic violation list. =head2 audit - Audit Log Lists all actions taken in the last days. =cut debug ' Inside EM module, collecting EMDIAG kit information' if testSql() {report no_access write '**Repository database connection disabled**%BR%',getSqlMessage() toc '2:[[',getFile(),'][rda_report][No Repository Access]]' } elsif check_emdiag_kit() call call_emdiag_kit($VIOLATION_AGE,$AUDIT_AGE) =head2 emctl - emctl Command Output Displays the output of the following F command options: =over 4 =item C =item C =item C or C =back =cut debug ' Inside EM module, collecting emctl information' var $ver = undef if grepCommand(concat($EMCTL,' status oms'),'\sRelease\s','f') var ($ver) = match(last,'\s(\d+(\.\d+){3,})') var @opt = ('getversion oms',\ 'status oms',\ cond(compare('older',$ver,'10.2.0.3'),'secure status oms',\ 'status oms -secure')) var @dsc = ('OMS version',\ 'Current OMS status',\ 'OMS secure status') var $cmd = exec_emctl($EMCTL,\@opt,\@dsc) =head2 oms_config - OMS Configuration Displays the output of the following configuration files: =over 24 =item F This file contains all the operational parameters for the OMS. =item F This file contains all the logging and tracing parameters for the OMS. =back =cut if !$IS11G {var @cfg = () var @log = () debug ' Inside EM module, collecting OMS configuration' call display_oms_config($ORACLE_HOME,\@cfg,\@log) } =head2 thread_dump - Thread Dump Displays the thread dump for OMS java process. It takes two thread dumps at an interval of 3 minutes. It produces this report when the C option is available. This option was added to the 10.2 version. =cut if and($cmd,grepCommand($cmd,'omsthread','f')) {debug ' Inside EM module, collecting a OMS thread dump (takes 3 minutes)' if $IS11G var $log = catFile($ORACLE_HOME,'logs','MAS','agent','oc4j_em~0') else var $log = catFile($ORACLE_HOME,'opmn','logs','OC4J~OC4J_EM~default_island~1') call dump_oms_threads(concat($cmd,' dump omsthread'),$log) } =head2 file_permissions - File/Directory Details Displays the details of the OMS receive directory, where Enterprise Manager stores all agent uploads before their upload in the repository. It also checks the directory ownership. =cut debug ' Inside EM module, collecting receive directory details' if $IS11G var %dir = (catDir($INSTANCE_HOME,'OC4JComponent','oc4j_em','sysman','recv'),\ 'o') else var %dir = (catDir($ORACLE_HOME,'sysman','recv'),'o') var %fil = () var @own = () call check_permissions('File/Directory Details',\@own,\%dir,\%fil) =head2 ping_test - Agent Ping Test When requested, performs a ping test to a specified host list. =cut if $PING_TEST {debug ' Inside EM module, performing ping tests' call ping_host('Agent Ping Test',split('\|',getSetting('EM_PING_LIST'))) } =head2 log_errors - Log Errors Filters all the lines with C message from various OMS log files. =cut debug ' Inside EM module, extracting errors from OMS log files' if $IS11G var @log = (\ grepDir(catDir($INSTANCE_HOME,'OC4JComponent','oc4j_em','sysman','log'),\ '.','np')) else var @log = (\ grepDir(catDir($ORACLE_HOME,'sysman','log'),'^emagent_memDump','npv')) call extract_errors('Log Errors',$TAIL,\@log) =head2 Log Files Collects the Database Control log files. =cut debug ' Inside EM module, collecting OMS log files' if $IS11G var @log = (\ grepDir(catDir($INSTANCE_HOME,'OC4JComponent','oc4j_em','sysman','log'),\ '.','np'),\ grepDir(catDir($ORACLE_HOME,'logs','MAS','agent'),'.','np')) else var @log = (\ grepDir(catDir($ORACLE_HOME,'j2ee','OC4J_EM','log',\ 'OC4J_EM_default_island_1'),'.','np'),\ grepDir(catDir($ORACLE_HOME,'sysman','log'),'^emagent_memDump','npv'),\ grepDir(catDir($ORACLE_HOME,'opmn','logs'),'.','np')) pretoc '2:Log Files' call sort_files(3,$TAIL,@log) unpretoc =head2 OMS Miscellaneous Files Collects various files. Some of the important files are as follows: =over 16 =item F This file specifies the list of special integration classes to be loaded when the Enterprise Manager application starts. These integration classes define and shape which special pages and features are enabled for the various target types. =item F This file contains OPMN settings. =item F This file contains specific settings for the OC4J application. =item F This file contains specific settings for the UIX Web pages including supported languages. =item F This file contains specific settings for the user interface. =back =cut debug ' Inside EM module, collecting miscellaneous OMS files' if !$IS11G {var @fil = (\ grepDir(catDir($ORACLE_HOME,'Apache','Apache','conf'),'.conf$','np'),\ grepDir(catDir($ORACLE_HOME,'cfgtoollogs'),'.','np'),\ grepDir(catDir($ORACLE_HOME,'config'),'.','np'),\ grepDir(catDir($ORACLE_HOME,'chgip','config'),'.','np'),\ grepDir(catDir($ORACLE_HOME,'chgip','log'),'.','np'),\ grepDir(catDir($ORACLE_HOME,'chgip','scripts'),'.','np'),\ grepDir(catDir($ORACLE_HOME,'dcm','config'),'.','np'),\ grepDir(catDir($ORACLE_HOME,'dcm','logs'),'^log.xml$','dir'),\ grepDir(catDir($ORACLE_HOME,'install'),'.','np'),\ catFile($ORACLE_HOME,'j2ee','OC4J_EM','application-deployments','em','em',\ 'orion-web.xml'),\ catFile($ORACLE_HOME,'j2ee','OC4J_EM','applications','em','em',\ 'WEB-INF','uix-config.xml'),\ catFile($ORACLE_HOME,'j2ee','OC4J_EM','applications','em','em',\ 'WEB-INF','web.xml'),\ grepDir(catDir($ORACLE_HOME,'opmn','conf'),'.','np'),\ grepDir(catDir($ORACLE_HOME,'sysman','config'),'.','np'),\ grepDir(catDir($ORACLE_HOME,'sysman','emd'),'.','np')) pretoc '2:Miscellaneous Files' call sort_files(3,undef,@fil) unpretoc } # Restore the previous database context call setSqlFailure($try) call setSqlLogin($old) =head1 SEE ALSO See also L, L. =begin credits =over 10 =item RDA 4.7: Werner De Gruyter. =item RDA 4.9: Smitha Nath. =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