# DCagt.cfg: Collects Oracle Enterprise Manager Agent Information # $Id: DCagt.cfg,v 1.11 2015/08/12 18:08:29 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/EM/DCagt.cfg,v 1.11 2015/08/12 18:08:29 RDA Exp $ # # Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. # # Change history # 20150811 KRA Include B_HCVE_CHECKS setting on version 12c and later. ############################################################################### # Collect Oracle Enterprise Manager Agent setup information ############################################################################### #------------------------------------------------------------------------------ # Module definition #------------------------------------------------------------------------------ col=${B_IN_USE} dsc='Collects Oracle Enterprise Manager Agent Information' pre=RDA:DCbegin rpt=B_IN_USE,D_BASE_HOME,D_ORACLE_HOME,D_HOME,B_EMDIAG_IN_USE var=not_used # Flow:in_use,B_IN_USE exe=sdcl { "var @{AUX.var} = (cond(${PRF.B_TESTS},'in_use','B_IN_USE')) " "macro is_valid_top "{var ($nam,$dir) = @arg " require testDir('d',$dir),\ " 'The specified EMDIAG kit directory does not exist.' " require isAbsolute($dir),\ " 'The specified EMDIAG kit directory is not an absolute path.' " require testFile('f',catFile($dir,'bin',${AS.BATCH:'agtvfy'})),\ " "The specified EMDIAG kit directory does not have a '${AS.BATCH:'agtvfy'}' \ " file in its 'bin' subdirectory." " var ${AUX.nam} = $nam " return true "} } #------------------------------------------------------------------------------ # Setting definitions #------------------------------------------------------------------------------ [in_use] typ=B dft=true dsc='Is Oracle Enterprise Manager Agent information requested?' nam=B_IN_USE var=D_HOME,chk_version,B_EMDIAG_IN_USE,B_INTERIM [not_used] typ=B dft=false dsc='Is Oracle Enterprise Manager Agent information requested?' nam=B_IN_USE [B_IN_USE] typ=B dft=${AUX.B_SELECTED} dsc='Is Oracle Enterprise Manager Agent information requested?' inp='Do you want RDA to analyze Oracle Enterprise Manager Agent (Y/N)?' var=true:D_HOME,chk_version,B_EMDIAG_IN_USE,B_INTERIM [D_HOME] typ=D dsc='Agent home directory' err='Warning: The specified directory does not -yet- exist' inp='For Oracle Enterprise Manager Cloud Control 12c, enter the agent \ instance directory location. For earlier versions, enter the Grid \ Control agent home directory location.' val=W exe=sdcl { "if ${D_HOME/M} "{var ($dir,$hom) = \ " (${GRP.GRID.D_SERVER_HOME:''},${SET.RDA.BEGIN.D_ORACLE_HOME:''}) " if ?nvl(testDir('d',cleanPath([$dir,upDir(),'agent10g',''],true)),\ " testDir('d',catDir($dir,'agent10g')),\ " testDir('d',cleanPath([$dir,upDir(),'agent11g',''],true)),\ " testDir('d',catDir($dir,'agent11g')),\ " testDir('d',cleanPath([$hom,upDir(),'agent10g',''],true)),\ " testDir('d',catDir($hom,'agent10')),\ " testDir('d',cleanPath([$hom,upDir(),'agent11g',''],true)),\ " testDir('d',catDir($hom,'agent11'))) " var ${AUX.dft} = last " elsif ?nvl(\ " testDir('d',cleanPath([$dir,upDir(),upDir(),'agent_inst',''],true)),\ " testDir('d',cleanPath([$hom,upDir(),upDir(),'agent_inst',''],true))) " {var $top = last " if ?testDir('d',cleanPath([$top,upDir(),'core',''],true)) " {if grepDir(last,'^emctl(\.bat)?$','firw',2) " var ${D_TMP_OH/T} = cleanPath([last,upDir(),''],true) " } " if ?testFile('f',catFile($top,'bin',${AS.BATCH:'emctl'})) " var ${AUX.dft} = $top " } "} } [chk_version] typ=B dft=compare('VALID',${T_TMP_AGT},'12') dsc='Check for Cloud Control 12c install' nam=- var=false:extra_tnsadmin:\ D_ORACLE_HOME,base_home,B_HCVE_CHECKS exe=sdcl { "var ($pgm,$ver) = (catCommand(${D_HOME},'bin',${AS.BATCH:'emctl'}),'') "once "{if loadCommand({cmd => concat($pgm,' status agent'),\ " env => {PERL5LIB => ${ENV.PERL5LIB},\ " PERL5OPT => ${ENV.PERL5OPT}}}) " {if grepLastFile('\sRelease\s','f') " break ($ver) = match(last,'\s(\d+(\.\d+){3,})') " if grepLastFile('12c\sRelease\s','f') " break $ver = 12 " if grepLastFile('\sCloud Control\s','f') " break ($ver) = match(last,'\s(\d+(\.\d+){3,})') " if grepLastFile('\sCloud Control\s12c','f') " break $ver = 12 " } " if loadCommand({cmd => concat($pgm,' getversion agent'),\ " env => {PERL5LIB => ${ENV.PERL5LIB},\ " PERL5OPT => ${ENV.PERL5OPT}}}) " {if grepLastFile('\sRelease\s','f') " break ($ver) = match(last,'\s(\d+(\.\d+){3,})') " if grepLastFile('12c\sRelease\s','f') " break $ver = 12 " if grepLastFile('\sCloud Control\s','f') " break ($ver) = match(last,'\s(\d+(\.\d+){3,})') " if grepLastFile('\sCloud Control\s12c','f') " break $ver = 12 " } "} "var ${T_TMP_AGT/T} = $ver } [extra_tnsadmin] typ=D dft=(catDir(${D_HOME},'bin'),\ catDir(${D_HOME},'network','admin'),\ catDir(${D_HOME},'network','agent')) dsc='List of extra TNS_ADMIN directories' end='.' nam=D_EXTRA_TNSADMIN [D_ORACLE_HOME] typ=D dft=${D_TMP_OH:${SET.RDA.BEGIN.D_ORACLE_HOME}} dsc='Agent core Oracle home directory' err='Warning: The specified directory does not -yet- exist' inp='Enter the Oracle Enterprise Manager Cloud Control Agent core Oracle home \ directory location' val=W exe=sdcl { "if ${D_ORACLE_HOME/M} "{if !?${D_TMP_OH} " {if ?testDir('d',cleanPath([${D_HOME},upDir(),'core',''],true)) " {if grepDir(last,'^emctl(\.bat)?$','firw',2) " var ${D_TMP_OH/T} = cleanPath([last,upDir(),''],true) " } " } "} } [base_home] typ=D dft=cleanPath([${D_ORACLE_HOME},upDir(),upDir(),''],true) dsc='Agent base home directory' nam=D_BASE_HOME [B_HCVE_CHECKS] typ=B dft=${PRF.B_HCVE_CHECKS} dsc='Are Oracle Enterprise Manager Agent 12c postinstallation checks requested?' inp='Do you want RDA to execute Oracle Enterprise Manager Agent 12c \ postinstallation checks (Y/N)?' lvl=6 [B_EMDIAG_IN_USE] typ=B dft=false dsc='Is Agent EMDIAG kit information requested?' inp='Do you want to run the EMDIAG AGTVFY diagnostic kit (Y/N)?' var=true:D_EMDIAG_TOP [D_EMDIAG_TOP] typ=D dsc='Agent EMDIAG kit directory' inp='To collect AGTVFY information from a local EMDIAG kit installation, enter \ the EMDIAG AGTVFY kit top-level directory location.' nam=- ref=is_valid_top('D_EMDIAG_TOP',last) val=W exe=sdcl { "if ${D_EMDIAG_TOP/M} "{if and(compare('VALID',${T_TMP_AGT},'12'),\ " testDir('d',catDir(${D_ORACLE_HOME},'emdiag'))) " var ${AUX.dft} = lastDir() "} } [B_INTERIM] typ=B dft=false dsc='Collect the file/directory list for the interim patches' inp='Do you want to collect the file/directory list for the interim patches \ in inventory (Y/N)?' lvl=6