# OFMem.ctl: Collects Oracle Fusion Middleware Plug-in Information # $Id: OFMem.ctl,v 1.5 2015/05/29 05:32:33 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/EM/OFMem.ctl,v 1.5 2015/05/29 05:32:33 RDA Exp $ # # Change History # 20150526 KRA Improve the documentation. =head1 NAME EM:OFMem - Collects Oracle Fusion Middleware Plug-in Information =head1 DESCRIPTION This module collects Oracle Fusion Middleware Plug-in-related information. =head1 REPORTS =cut keep $KEEP_BLOCK return # --- begin section ----------------------------------------------------------- section begin # Load the common macros run EM:EMdiag() # ----------------------------------------------------------------------------- # Section Init: Define the plugin capabilities # ----------------------------------------------------------------------------- section Init # Define the plugin capabilities var $plg = $arg[0] var $ctl = {WLS => {ini => {em_grid => 'EM:OFMem-WLS_GRID_Init'},\ srvlog => {EM_GRID => 'EM:OFMem-WLS_GRID_Log'}}} loop $key (keys($ctl,'*')) var $plg->{@{$key}} = $ctl->{@{$key}} # ----------------------------------------------------------------------------- # Section WLS_GRID_Init: Get the GRID servers # ----------------------------------------------------------------------------- section WLS_GRID_Init var ($top,$dom) = @arg delete $GRID if ?testFile('fr',catFile($top,'config','config.xml')) {var $obj = xmlLoadFile(lastFile(),xmlDisable(xmlParser(),'BCDEPR')) if compare('EQ',$dom,xmlData(xmlFind($obj,'domain/name'))) {loop $xml (xmlFind($obj,'domain/app-deployment')) {if match($app = xmlData(xmlFind($xml,'name')),'^emgc$') {var $GRID = [$app,xmlData(xmlFind($xml,'target'))] keep $GRID break } } } } # ----------------------------------------------------------------------------- # Section WLS_GRID_Log: Collect GRID log files for Oracle WebLogic Server # ----------------------------------------------------------------------------- section WLS_GRID_Log =head2 OMS Log Errors Extracts C records from the specified Oracle Management Server-related log files. =cut var ($dir,$lim) = @arg if ?$GRID {debug ' - Inside OFMem module, gathering OMS log errors' var ($max,@fil) = (${SET.OFM.WREQ.N_ROTATED_LOGS:2}) var (undef,$trg) = @{$GRID} loop $nam (grepDir(catDir($dir,'logs'),\ concat('^',$trg,'-diagnostic-?\d*\.log$'),'it')) {call push(@fil,catFile($dir,'logs',$nam)) if match($nam,concat('^',$trg,'-diagnostic\.log$'),true) {break !$max next } break !decr($max) } call extract_errors('log_errors',3,'OMS Log Errors',$lim,@fil) } =head1 SEE ALSO L =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