# S420AGT.def: Collects Enterprise Manager Agent Information # $Id: S420AGT.def,v 1.31 2009/02/24 17:46:46 mschenke Exp $ # ARCS: $Header: /u02/webapps/workbench/cvs/RDA_4/src/scripting/lib/modules/S420AGT.def,v 1.31 2009/02/24 17:46:46 mschenke Exp $ # # Change History # 20090217 DEM Remove cfgtoollogs base directory as moved to INST module. =head1 NAME S420AGT - Collects Enterprise Manager Agent Information =head1 DESCRIPTION This module collects Enterprise Manager Agent-related information. The following reports can be generated and are regrouped under C: =cut echo tput('bold'),'Processing EM Agent module ...',tput('off') # Initialization var $AGENT_STATE_DIR = getSetting('AGT_AGENT_STATE_DIR') var $ORACLE_HOME = getSetting('ORACLE_HOME') var $TAIL = getSetting('RDA_TAIL',1000) var $EMCTL = catFile($AGENT_STATE_DIR,'bin',\ cond(isWindows(),'emctl.bat','emctl')) var $LNAME = getSetting('MACHINE_NAME') var $FNAME = concat($LNAME,'.',getSetting('DOMAIN_NAME')) var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' var $ERR = ' (error)' var $OH = quote($ORACLE_HOME) var $OH1 = concat('^',$OH,'\b') # Load the common macros run library() run EMdiag() # Validate the context #var $CFG = get_config($EMCTL) #var $DBC = match($CFG,'dbconsole|true') #if $DBC #{echo 'Use the DBC module for this DBControl install.' # return #} if get_agent_name($AGENT_STATE_DIR) toc '1:EM Agent (',last,')' else toc '1:Enterprise Manager Agent' =head2 emctl - emctl Command Output Displays the output of the following F command options: =over 4 =item o C =item o C =item o C =item o C =item o C =item o C =item o C or C =item o C =back =cut debug ' Inside AGT 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 = ('status agent',\ 'upload',\ 'status agent scheduler',\ 'status agent memory',\ 'status agent jobs',\ 'config agent getTZ',\ 'status agent secure',\ cond(compare('older',$ver,'10.2.0.3'),'secure status agent',\ 'status agent -secure'),\ 'pingOMS') var @dsc = ('Current status of the agent',\ 'Makes upload request to the OMS. Show error message (if any) \ returned by the OMS in response to the request.',\ 'Collections currently scheduled for the agent',\ 'Current memory footprint of agent',\ 'List of current jobs running in the agent.',\ 'Agent Time Zone',\ 'Secure status of the agent',\ 'Agent to OMS HTTP(S) ping test') var $cmd = exec_emctl($EMCTL,\@opt,\@dsc) =head2 monitored_targets - Monitored Targets Displays the targets in the F file of the agent and performs some pre-defined tests on target properties. It displays also the current state of the target and its blackout information. =cut debug ' Inside AGT module, collecting monitored target information' call display_targets($cmd,$AGENT_STATE_DIR,\ 'v,oracle_database,UserName,.',\ 'v,oracle_database,password,.',\ 'f,oracle_listener,ListenerOraDir,.',\ 'h,oracle_ias,StatusURL,.',\ concat('tn,oracle_emd,should start with host name,^',\ quote(concat(getSetting('MACHINE_NAME'),'.',\ getSetting('DOMAIN_NAME'))))) =head2 ping_test - OMS Ping Test Displays the output of the ping test performed on the OMS. This test picks OMS from the C property in the F file. =cut debug ' Inside AGT module, performing OMS ping test' call ping_host('OMS Ping Test',get_repository_host($AGENT_STATE_DIR)) =head2 agent_config - Agent Configuration Collects the following configuration files: =over 24 =item F This file contains all the operational parameters for the agent. =item F This file contains the logging setup for the Java fetchlets. =back It performs some pre-defined tests on the configuration properties also. It reports failures. =cut debug ' Inside AGT module, collecting agent configuration' var @cfg = ('f,emdRootCertLoc,.') var @log = () call display_agent_config($AGENT_STATE_DIR,\@cfg,\@log) =head2 file_permissions - File/Directory Details Displays the details of some files and directories and checks the ownership and permissions. =cut debug ' Inside AGT module, collecting files/directories details' var %dir = (catDir($AGENT_STATE_DIR,'sysman','emd','upload'),'o',\ catDir($AGENT_STATE_DIR,'sysman','emd','state'),'o',\ catDir($AGENT_STATE_DIR,'sysman','emd','collection'),'o',\ $AGENT_STATE_DIR,'o') var %fil = ($EMCTL,'xo') var @own = (catFile($ORACLE_HOME,'bin','nmb'),\ catFile($ORACLE_HOME,'bin','nmo'),\ catFile($ORACLE_HOME,'bin','nmhs')) call check_permissions('File/Directory Details',\@own,\%dir,\%fil) =head2 log_errors - Log Errors Filters all the lines with C message from various OMS log files. =cut debug ' Inside DBC module, extracting errors from OMS log files' call extract_errors('Log Errors',$TAIL,\ grepDir(catDir($AGENT_STATE_DIR,'sysman','log'),'^emagent_memDump','npv')) =head2 Log Files Collects the agent log files. =cut debug ' Inside AGT module, collecting agent log files' pretoc '2:Log Files' call sort_files(3,$TAIL,\ grepDir(catDir($AGENT_STATE_DIR,'sysman','log'),'^emagent_memDump','npv'),\ grepDir(catDir($AGENT_STATE_DIR,'sysman','emd'),'.traceback','np')) unpretoc =head2 Miscellaneous Files Collects agent files. Some of the important files are as follows: =over 24 =item F This file contains the list of all OUI inventories on the machine to be considered by the agent. =item F This file contains the time stamp of the last heartbeat to the OMS. =item F This file contains a list of all discovery scripts that must be run for discovery. Discovery is run only once, typically during the installation of the Enterprise Manager Agent. =item F This file has information about categories properties computed for various targets. =item F This file contains the names of all supported time zones. =item F This file contains the version-specific information of the OMS, which is required by the agent to communicate properly. =item F This file is generated by OUI during the installation of the Enterprise Manager Agent. It contains installation-specific information. =item F This file contains the names of all supported time zones. =item F This file contains the names of all supported time zones. =back =cut debug ' Inside AGT module, collecting miscellaneous agent files' pretoc '2:Miscellaneous Files' call sort_files(3,undef,\ grepDir(catDir($ORACLE_HOME,'cfgtoollogs','cfgfw'),'\.log$','np'),\ grepDir(catDir($ORACLE_HOME,'install'),'.','np'),\ catFile($ORACLE_HOME,'sysman','setupinfo.txt'),\ catFile($ORACLE_HOME,'sysman','admin','nsupportedtzs.lst'),\ catFile($ORACLE_HOME,'sysman','admin','supportedtzs.lst'),\ catFile($ORACLE_HOME,'sysman','admin','tzmappings.lst'),\ catFile($ORACLE_HOME,'sysman','admin','discover','discover.lst'),\ grepDir(catDir($ORACLE_HOME,'sysman','config'),'.','np'),\ grepDir(catDir($ORACLE_HOME,'sysman','emd'),'.','np'),\ grepDir(catDir($AGENT_STATE_DIR,'sysman','config'),'.','np'),\ grepDir(catDir($AGENT_STATE_DIR,'sysman','emd'),'.','np'),\ grepDir(catDir($ORACLE_HOME,$LNAME,'sysman','config'),'.','np'),\ grepDir(catDir($ORACLE_HOME,$LNAME,'sysman','emd'),'.','np'),\ grepDir(catDir($ORACLE_HOME,$FNAME,'sysman','config'),'.','np'),\ grepDir(catDir($ORACLE_HOME,$FNAME,'sysman','emd'),'.','np')) unpretoc =head1 SEE ALSO L, L =begin credits =over 10 =item RDA 4.9: Smitha Nath. =back =end credits =head1 COPYRIGHT NOTICE Copyright (c) 2002-2009, 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