# S343OUD.def: Collects Oracle Unified Directory Information # $Id: S343OUD.def,v 1.3 2012/08/22 13:19:17 mschenke Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_4/src/scripting/lib/modules/S343OUD.def,v 1.3 2012/08/22 13:19:17 mschenke Exp $ # # Change History # 20120821 KRA Improve hang capture collection. =head1 NAME S343OUD - Collects Oracle Unified Directory Information =head1 DESCRIPTION This module collects information for Oracle Unified Directory. The following reports can be generated and are regrouped under C: =head1 REPORTS =cut echo tput('bold'),'Processing OUD module ...',tput('off') # Initialization var $ADMIN_PORT = getSetting('OUD_ADMIN_PORT') var $ADMIN_USER = getSetting('OUD_ADMIN_USER','admin') var $ADVANCED = getSetting('OUD_ADVANCED',false) var $DIR_MANAGER = getSetting('OUD_DIR_MANAGER','cn=Directory Manager') var $HOST = getSetting('OUD_HOST',${RDA.HOST}) var $INSTANCE = getSetting('OUD_INSTANCE','') var $JDK_HOME = getSetting('OUD_JDK','') var $LDAP_PORT = getSetting('OUD_LDAP_PORT') var $LDAPS_PORT = getSetting('OUD_LDAPS_PORT') var $LOOP = getSetting('OUD_LOOP',4) var $ORACLE_HOME = getSetting('ORACLE_HOME','') var $REPLICATION = getSetting('OUD_REPLICATION',false) var $SLEEP = getSetting('OUD_SLEEP',30) var $TAIL = getSetting('RDA_TAIL',1000) if or(isWindows(),isCygwin()) {var $BIN = 'bat' var $MOD = 'fr' } else {var $BIN = 'bin' var $MOD = 'fx' } var $OUD = catDir($INSTANCE,'OUD') var $LDAPSEARCH = catFile($OUD,$BIN,${AS.BATCH:'ldapsearch'}) var $PRE = setPrefix() var %MNU loop $itm (split('\|',getSetting('OUD_MENU',''))) var $MNU{$itm} = true var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' pretoc '1:Oracle Unified Directory' # Validate the settings if !match($LOOP,'^\d+$') var $LOOP = 4 if !match($SLEEP,'^\d+$') var $SLEEP = 30 # Create password files var $adm = quote(createTemp('ADMIN','.tmp',false),'x') if getSetting('SQL_PASSWORD_OUD_ADMIN') var ($pwd) = unpack('u',last) else var $pwd = askPassword('Enter admin password:') call writeTemp('ADMIN',$pwd) call closeTemp('ADMIN') var $bnd = quote(createTemp('BIND','.tmp',false),'x') if getSetting('SQL_PASSWORD_OUD_DIRECTORY_MANAGER') var ($pwd) = unpack('u',last) else var $pwd = askPassword('Enter directory manager password:') call writeTemp('BIND',$pwd) call closeTemp('BIND') echo 'This can take time. Please be patient...' # Load the common library run library() # Set the instance symbol call setSymbol('$OI',$INSTANCE) =head2 abbr - Abbreviations Displays the RDA abbreviations defined for the Oracle Unified Directory collection. =cut debug ' Inside OUD module, collecting defined abbreviations' report abbr prefix {write '---+ Oracle Unified Directory Abbreviations' write '|*Abbreviation*|*Location*|' } var %hsh = getSymbols() loop $key (keys(%hsh)) write '|',$key,' |',catDir(@{$hsh{$key}}),' |' if isCreated(true) toc '2:[[',getFile(),'][rda_report][Abbreviations]]' =head2 param_info - Parameter Information Gathers the user defined parameters. =cut debug ' Inside OUD module, getting parameter details' report param_info write '---+ Parameter Information' write '|*Oracle Home*|',encode($ORACLE_HOME),' |' write '|*Oracle Instance*|',encode($INSTANCE),' |' write '|*Admin User*|',$ADMIN_USER,' |' write '|*Admin Port*|',$ADMIN_PORT,' |' write '|*Directory Manager*|',$DIR_MANAGER,' |' write '|*LDAP Port*|',$LDAP_PORT,' |' write '|*LDAPS Port*|',$LDAPS_PORT,' |' write '|*Hostname*|',$HOST,' |' write '|*JDK Path*|',encode($JDK_HOME),' |' toc '2:[[',getFile(),'][rda_report][Parameter Information]]' =head2 version - Version Information Gathers version information. =cut if testFile($MOD,catFile($OUD,$BIN,${AS.BATCH:'dsconfig'})) {debug ' Inside OUD module, getting version information' var $cmd = concat(lastCommand(),' -V') report version prefix {write '---+ Version Information' write '---## Using: ',encode($cmd) } call writeCommand($cmd) if isCreated(true) toc '2:[[',getFile(),'][rda_report][Version Information]]' } =head2 status - Status Information Gathers status information. =cut if testFile($MOD,catFile($OUD,$BIN,${AS.BATCH:'status'})) {debug ' Inside OUD module, gathering status information' var $cmd = concat(lastCommand(),' --bindDN "',$DIR_MANAGER,\ '" --bindPasswordFile ',$bnd) report status prefix {write '---+ Status Information' write '---## Using: ',encode($cmd) } call writeCommand($cmd) if isCreated(true) {write $TOP toc '2:[[',getFile(),'][rda_report][Status Information]]' } } =head2 aci_info - Access Control Information Gathers access control information. =cut if testFile($MOD,$LDAPSEARCH) {var $pgm = quote($LDAPSEARCH,'x') # Macro to get the output of ldapsearch command macro exec_ldapsearch {var ($tbl,$cmd,$pre,$flg) = @arg import $TOP keep $TOP report $tbl->[1] prefix {write '---+ ',$tbl->[2] write '---## Using: ',encode($cmd) if $pre write '---### Executed at: ',${RDA.GMTIME},' UTC' } if $flg {call loadCommand(concat($cmd,' 2>&1')) call writeLastFile() } else call writeCommand(concat($cmd,' 2>&1')) if isCreated(true) {write $TOP toc $tbl->[0],':[[',getFile(),'][rda_report][',$tbl->[-1],']]' } } debug ' Inside OUD module, gathering access control handler information' var $cmd = concat(\ $pgm,' -X -Z -p ',$ADMIN_PORT,' -D "',$DIR_MANAGER,'" --bindPasswordFile ',\ $bnd,' -b "cn=Access Control Handler,cn=config" objectclass=*') call exec_ldapsearch([2,'aci_info','Access Control Information'],$cmd) =head2 Connection Handlers Gathers connection handlers information. =cut debug ' Inside OUD module, gathering connection handler information' pretoc '2:Connection Handlers' =head3 ldap_conn_hdl - LDAP Connection Handler Gathers Lightweight Directory Access Protocol (non-SSL) connection handler information. =cut debug ' - gathering LDAP connection handler information' var $cmd = concat(\ $pgm,' -X -Z -p ',$ADMIN_PORT,' -D "',$DIR_MANAGER,'" --bindPasswordFile ',\ $bnd,' -b "cn=LDAP Connection Handler,cn=Connection Handlers,cn=config" \ objectclass=*') call exec_ldapsearch(\ [3,'ldap_conn_hdl','LDAP (non-SSL) Connection Handler Information',\ 'LDAP Connection Handler'],$cmd) =head3 ldaps_conn_hdl - LDAPS Connection Handler Gathers Lightweight Directory Access Protocol (SSL) connection handler information. =cut debug ' - gathering LDAPS connection handler information' var $cmd = concat(\ $pgm,' -X -Z -p ',$ADMIN_PORT,' -D "',$DIR_MANAGER,'" --bindPasswordFile ',\ $bnd,' -b "cn=LDAPS Connection Handler,cn=Connection Handlers,cn=config" \ objectclass=*') call exec_ldapsearch(\ [3,'ldaps_conn_hdl','LDAP (SSL) Connection Handler Information',\ 'LDAPS Connection Handler'],$cmd) =head3 snmp_conn_hdl - SNMP Connection Handler Gathers Simple Network Management Protocol connection handler information. =cut debug ' - gathering SNMP connection handler information' var $cmd = concat(\ $pgm,' -X -Z -p ',$ADMIN_PORT,' -D "',$DIR_MANAGER,'" --bindPasswordFile ',\ $bnd,' -b "cn=SNMP Connection Handler,cn=Connection Handlers,cn=config" \ objectclass=*') call exec_ldapsearch(\ [3,'snmp_conn_hdl','SNMP Connection Handler Information',\ 'SNMP Connection Handler'],$cmd) =head3 jmx_conn_hdl - JMX Connection Handler Gathers Java Management Extensions connection handler information. =cut debug ' - gathering JMX connection handler information' var $cmd = concat(\ $pgm,' -X -Z -p ',$ADMIN_PORT,' -D "',$DIR_MANAGER,'" --bindPasswordFile ',\ $bnd,' -b "cn=JMX Connection Handler,cn=Connection Handlers,cn=config" \ objectclass=*') call exec_ldapsearch(\ [3,'jmx_conn_hdl','JMX Connection Handler Information',\ 'JMX Connection Handler'],$cmd) =head3 ldif_conn_hdl - LDIF Connection Handler Gathers Lightweight Directory Interchange Format connection handler information. =cut debug ' - gathering LDIF connection handler information' var $cmd = concat(\ $pgm,' -X -Z -p ',$ADMIN_PORT,' -D "',$DIR_MANAGER,'" --bindPasswordFile ',\ $bnd,' -b "cn=LDIF Connection Handler,cn=Connection Handlers,cn=config" \ objectclass=*') call exec_ldapsearch(\ [3,'ldif_conn_hdl','LDIF Connection Handler Information',\ 'LDIF Connection Handler'],$cmd) unpretoc =head2 db_config - Database Configuration Gathers Oracle Unified Directory-related database configuration information. =cut debug ' Inside OUD module, gathering database configuration information' var $cmd = concat(\ $pgm,' -X -Z -p ',$ADMIN_PORT,' -D "',$DIR_MANAGER,'" --bindPasswordFile ',\ $bnd,' -b "cn=userRoot,cn=Workflow elements,cn=config" objectclass=*') call exec_ldapsearch(\ [2,'db_config','Database Configuration Information',\ 'Database Configuration'],$cmd) } =head2 Replication Information Gathers Oracle Unified Directory-related replication information. =head3 replication_status - Replication Status Gathers replication status information using F command. =cut if $REPLICATION {debug ' Inside OUD module, gathering replication information' pretoc '2:Replication Information' if testFile($MOD,catFile($OUD,$BIN,${AS.BATCH:'dsreplication'})) {debug ' - gathering replication status information' var $cmd = concat(\ lastCommand(),' status -h ',$HOST,' -p ',$ADMIN_PORT,' --adminUID ',\ $ADMIN_USER,' --adminPasswordFile ',$adm,' -X -n') report replication_status prefix {write '---+ Replication Status Information' write '---## Using: ',encode($cmd) } call writeCommand(concat($cmd,' 2>&1')) if isCreated(true) {write $TOP toc '3:[[',getFile(),'][rda_report][Replication Status]]' } } =head3 replication_domains - Replication Domains Gathers replication domains information using F command. =cut var @dom = () if testFile($MOD,catFile($OUD,$BIN,${AS.BATCH:'dsconfig'})) {debug ' - gathering replication domains information' var $cmd = concat(\ $pgm = lastCommand(),' -h ',$HOST,' -p ',$ADMIN_PORT,' -D "',\ $DIR_MANAGER,'" --bindPasswordFile ',$bnd,' -X list-replication-domains \ --provider-name "Multimaster Synchronization"') report replication_domains prefix {write '---+ Replication Domains Information' write '---## Using: ',encode($cmd) } call loadCommand($cmd) loop $lin (getLines()) {next match($lin,'^(Replication Domain|-+|\s*$|cn=admin data|cn=schema)') call push(@dom,field('\s*:\s*',0,$lin)) } call writeLastFile() if isCreated(true) {write $TOP toc '3:[[',getFile(),'][rda_report][Replication Domains]]' } =head3 replication_srv_prop - Replication Server Properties Gathers replication server properties information using F command. =cut debug ' - gathering replication server properties information' var $cmd = concat(\ $pgm,' -h ',$HOST,' -p ',$ADMIN_PORT,' -D "',$DIR_MANAGER,\ '" --bindPasswordFile ',$bnd,' -X get-replication-server-prop \ --provider-name "Multimaster Synchronization"') report replication_srv_prop prefix {write '---+ Replication Server Properties Information' write '---## Using: ',encode($cmd) } call writeCommand($cmd) if isCreated(true) {write $TOP toc '3:[[',getFile(),'][rda_report][Replication Server Properties]]' } =head3 replication_dom_prop - Replication Domain Properties Gathers replication domain properties information using F command. =cut debug ' - gathering replication domain properties information' var $cmd = concat(\ $pgm,' -h ',$HOST,' -p ',$ADMIN_PORT,' -D "',$DIR_MANAGER,\ '" --bindPasswordFile ',$bnd,' -X get-replication-domain-prop \ --provider-name "Multimaster Synchronization" \ --domain-name "dc=example,dc=com"') report replication_dom_prop prefix {write '---+ Replication Domain Properties Information' write '---## Using: ',encode($cmd) } call writeCommand($cmd) if isCreated(true) {write $TOP toc '3:[[',getFile(),'][rda_report][Replication Domain Properties]]' } } =head3 Monitoring Replications Gathers monitoring replications information for each replication domain. =cut if testFile($MOD,catFile($OUD,$BIN,${AS.BATCH:'ldapsearch'})) {debug ' - gathering replication domains information' pretoc '3:Monitoring Replications' loop $dom (@dom) {var $cmd = concat(\ lastCommand(),' -X -Z -h ',$HOST,' -p ',$ADMIN_PORT,' -D "',\ $DIR_MANAGER,'" --bindPasswordFile ',$bnd,\ ' -b cn=replication,cn=monitor domain-name=',$dom) report concat('replication_dom_mon_',$dom) prefix {write "---+ '",$dom,"' Monitoring Replications" write '---## Using: ',encode($cmd) } call writeCommand($cmd) if isCreated(true) {write $TOP toc '4:[[',getFile(),'][rda_report][',$dom,']]' } } unpretoc } unpretoc } =head2 Configuration Files Gathers Oracle Unified Directory-related configuration files. =cut debug ' Inside OUD module, gathering configuration files' pretoc '2:Configuration Files' call sort_files(3,0,\ catFile($OUD,'config','admin-backend.ldif'),\ catFile($OUD,'config','buildinfo'),\ catFile($OUD,'config','config.ldif'),\ catFile($OUD,'config','config.ldif.startok'),\ catFile($OUD,'config','java.properties'),\ catFile($OUD,'config','tasks.ldif'),\ catFile($OUD,'config','tools.properties'),\ grepDir(catDir($OUD,'config','archived-configs'),'^\.+$','drv'),\ grepDir(catDir($OUD,'config','concat-schema'),'^\.+$','drv'),\ grepDir(catDir($OUD,'config','schema'),'^\.+$','drv'),\ grepDir(catDir($OUD,'config','snmp'),'^\.+$','drv')) unpretoc =head2 Log Files Gathers Oracle Unified Directory-related log files. =head3 log_cfg_settings - Logging Configuration Settings Gathers Oracle Unified Directory-related logging configuration settings. =cut debug ' Inside OUD module, gathering logging configuration settings' pretoc '2:Log Files' var $cmd = concat(\ catFile($OUD,$BIN,${AS.BATCH:'dsconfig'}),' -h ',$HOST,' -p ',\ $ADMIN_PORT,' -D "',$DIR_MANAGER,'" --bindPasswordFile ',$bnd,\ ' -X list-log-publishers') report log_cfg_settings prefix {write '---+ Logging Configuration Settings Information' write '---## Using: ',encode($cmd) } call writeCommand($cmd) if isCreated(true) toc '3:[[',getFile(),'][rda_report][Logging Configuration Settings]]' debug ' Inside OUD module, gathering log files' call sort_files(3,$TAIL,\ catFile($OUD,'logs','native-windows.out'),\ grepDir(catDir($OUD,'logs'),\ '^(access|debug|errors|replication|server\.output)','np'),\ grepDir(catDir($OUD,'dbUserRoot'),'^je\.info','np'),\ grepDir(catDir($OUD,'bin'),'^hs_err_pid.*\.log$','p')) unpretoc =head1 DATABASE INFORMATION Gathers Oracle Unified Directory-related database information in advanced mode. =cut if and($ADVANCED,exists($MNU{'DB_INFO'})) {debug ' Inside OUD module, gathering database information' pretoc '%SPLIT%' pretoc '1+:Database Information' if testFile($MOD,catFile($OUD,$BIN,${AS.BATCH:'dbtest'})) {var ($cmd,@bid) = (concat($pgm = lastCommand(),' list-root-containers')) =head2 root_containers - Root Containers Lists root containers information. =cut debug ' - gathering root containers list' report root_containers prefix {write '---+ Root Containers Information' write '---## Using: ',encode($cmd) } call loadCommand($cmd) loop $lin (getLines()) {next match($lin,'^(Backend\s+ID|-+|\s*$|Total:)') call push(@bid,field('\s+',0,$lin)) } call writeLastFile() if isCreated(true) {write $TOP toc '2:[[',getFile(),'][rda_report][Root Containers]]' } =head2 Entry Containers Lists entry containers information for each C. =cut debug ' - gathering entry containers information' pretoc '2:Entry Containers' loop $bid (@bid) {var ($cmd,@bdn) = (concat($pgm,' list-entry-containers -n ',$bid)) report concat('entry_containers_',$bid) prefix {write "---+ '",$bid,"' Entry Container Information" write '---## Using: ',encode($cmd) } call loadCommand($cmd) loop $lin (getLines()) {next match($lin,'^(Base\s+DN|-+|\s*$|Total:)') call push(@bdn,field('\s+',0,$lin)) } call writeLastFile() if isCreated(true) {write $TOP toc '3:[[',getFile(),'][rda_report][',$bid,']]' } =head3 Index Status Lists index status information for each C per C. =cut if @bdn {debug ' - gathering index status information for ',$bid pretoc '4:Index Status' loop $bdn (@bdn) {var $cmd = concat($pgm,' list-index-status -b ',$bdn,' -n ',$bid) report concat('index_status_',$bid,'_',$bdn) prefix {write "---+ '",$bdn,"' Index Status Information (",$bid,')' write '---## Using: ',encode($cmd) } call writeCommand($cmd) if isCreated(true) {write $TOP toc '5:[[',getFile(),'][rda_report][',$bdn,']]' } } unpretoc } } unpretoc =head2 Database Containers Lists database containers information for each C. =cut debug ' - gathering database containers information' pretoc '2:Database Containers' loop $bid (@bid) {var $cmd = concat($pgm,' list-database-containers -n ',$bid) report concat('database_containers_',$bid) prefix {write "---+ '",$bid,"' Database Container Information" write '---## Using: ',encode($cmd) } call writeCommand($cmd) if isCreated(true) {write $TOP toc '3:[[',getFile(),'][rda_report][',$bid,']]' } } unpretoc } unpretoc 2 } =head1 MONITOR INFORMATION Gathers monitor information. =cut if testFile($MOD,$LDAPSEARCH) {pretoc '%SPLIT%' pretoc '1+:Monitor Information' var $pgm = quote($LDAPSEARCH,'x') var ($cur,$det,$max,$pre) = (0,2,1) if exists($MNU{'MONITOR_STAT'}) var ($det,$max,$pre) = (3,$LOOP,true) else debug ' Inside OUD module, gathering monitoring information' while expr('<',$cur,$max) {if and($cur,$SLEEP) {debug ' Inside OUD module, sleeping ',$SLEEP,' seconds' sleep $SLEEP } incr $cur if $pre {debug ' Inside OUD module, gathering monitoring (sample ',$cur,')' call setPrefix(concat($PRE,'cnt_',$cur)) pretoc '2:Iteration ',$cur } =head2 cn_monitor - Monitor Status Gathers monitor status information. =cut debug ' - gathering monitor status' var $cmd = concat(\ $pgm,' -X -Z -p ',$ADMIN_PORT,' -D "',$DIR_MANAGER,'" --bindPasswordFile ',\ $bnd,' -b "cn=monitor" objectclass=*') call exec_ldapsearch([$det,'cn_monitor','Monitor Status'],$cmd,$pre) =head2 cn_version - Version Information Gathers monitor version information. =cut debug ' - gathering version information' var $cmd = concat(\ $pgm,' -X -Z -p ',$ADMIN_PORT,' -D "',$DIR_MANAGER,'" --bindPasswordFile ',\ $bnd,' -b "cn=version,cn=monitor" objectclass=*') call exec_ldapsearch([$det,'cn_version','Version Information'],$cmd,$pre) =head2 cn_system - System Information Gathers monitor system information. =cut debug ' - gathering system information' var $cmd = concat(\ $pgm,' -X -Z -p ',$ADMIN_PORT,' -D "',$DIR_MANAGER,'" --bindPasswordFile ',\ $bnd,' -b "cn=System Information,cn=monitor" objectclass=*') call exec_ldapsearch([$det,'cn_system','System Information'],$cmd,$pre) =head2 cn_ldap_con_hdl - LDAP Connection Handler Gathers monitor Lightweight Directory Access Protocol (non-SSL) connection handler information. =cut debug ' - gathering LDAP connection handler information' var $cmd = concat(\ $pgm,' -X -Z -p ',$ADMIN_PORT,' -D "',$DIR_MANAGER,'" --bindPasswordFile ',\ $bnd,' -b "cn=LDAP Connection Handler 0.0.0.0 port ',$LDAP_PORT,\ ',cn=monitor" objectclass=*') call exec_ldapsearch(\ [$det,'cn_ldap_con_hdl','LDAP (non-SSL) Connection Handler Information',\ 'LDAP Connection Handler'],$cmd,$pre) =head2 cn_ldap_con_hdl_stat - LDAP Connection Handler Statistics Gathers monitor Lightweight Directory Access Protocol (non-SSL) connection handler statistics information. =cut debug ' - gathering LDAP connection handler statistics information' var $cmd = concat(\ $pgm,' -X -Z -p ',$ADMIN_PORT,' -D "',$DIR_MANAGER,'" --bindPasswordFile ',\ $bnd,' -b "cn=LDAP Connection Handler 0.0.0.0 port ',$LDAP_PORT,\ ' Statistics,cn=monitor" objectclass=*') call exec_ldapsearch(\ [$det,'cn_ldap_con_hdl_stat',\ 'LDAP (non-SSL) Connection Handler Statistics Information',\ 'LDAP Connection Handler Statistics'],$cmd,$pre) =head2 cn_ldaps_con_hdl - LDAPS Connection Handler Gathers monitor Lightweight Directory Access Protocol (SSL) connection handler information. =cut debug ' - gathering LDAPS connection handler information' var $cmd = concat(\ $pgm,' -X -Z -p ',$ADMIN_PORT,' -D "',$DIR_MANAGER,'" --bindPasswordFile ',\ $bnd,' -b "cn=LDAP Connection Handler 0.0.0.0 port ',$LDAPS_PORT,\ ',cn=monitor" objectclass=*') call exec_ldapsearch(\ [$det,'cn_ldaps_con_hdl','LDAP (SSL) Connection Handler Information',\ 'LDAPS Connection Handler'],$cmd,$pre) =head2 cn_ldaps_con_hdl_stat - LDAPS Connection Handler Statistics Gathers monitor Lightweight Directory Access Protocol (SSL) connection handler statistics information. =cut debug ' - gathering LDAPS connection handler statistics information' var $cmd = concat(\ $pgm,' -X -Z -p ',$ADMIN_PORT,' -D "',$DIR_MANAGER,'" --bindPasswordFile ',\ $bnd,' -b "cn=LDAP Connection Handler 0.0.0.0 port ',$LDAPS_PORT,\ ' Statistics,cn=monitor" objectclass=*') call exec_ldapsearch(\ [$det,'cn_ldaps_con_hdl_stat',\ 'LDAP (SSL) Connection Handler Statistics Information',\ 'LDAPS Connection Handler Statistics'],$cmd,$pre) =head2 cn_jvm_mem_usage - JVM Memory Usage Gathers monitor Java virtual machine memory usage information. =cut debug ' - gathering JVM memory usage information' var $cmd = concat(\ $pgm,' -X -Z -p ',$ADMIN_PORT,' -D "',$DIR_MANAGER,'" --bindPasswordFile ',\ $bnd,' -b "cn=JVM Memory Usage,cn=monitor" objectclass=*') call exec_ldapsearch(\ [$det,'cn_jvm_mem_usage','JVM Memory Usage Information',\ 'JVM Memory Usage'],\ $cmd,$pre) =head2 cn_jvm_stack_trace - JVM Stack Trace Gathers monitor Java virtual machine stack trace information. =cut debug ' - gathering JVM stack trace information' var $cmd = concat(\ $pgm,' -X -Z -p ',$ADMIN_PORT,' -D "',$DIR_MANAGER,'" --bindPasswordFile ',\ $bnd,' -b "cn=JVM Stack Trace,cn=monitor" objectclass=*') call exec_ldapsearch(\ [$det,'cn_jvm_stack_trace','JVM Stack Trace Information',\ 'JVM Stack Trace'],\ $cmd,$pre) =head2 cn_dsk_space - Disk Space Monitor Gathers monitor disk space information. =cut debug ' - gathering disk space monitor information' var $cmd = concat(\ $pgm,' -X -Z -p ',$ADMIN_PORT,' -D "',$DIR_MANAGER,'" --bindPasswordFile ',\ $bnd,' -b "cn=userRoot backend,cn=Disk Space Monitor,cn=monitor" \ objectclass=*') call exec_ldapsearch(\ [$det,'cn_dsk_space','Disk Space Monitor Information',\ 'Disk Space Monitor'],\ $cmd,$pre,true) =head2 cn_db_size - Database Size Gathers monitor database size information. This check is applicable for UNIX only. =cut if isUnix() {debug ' - gathering database size information' if grepLastFile('^disk-dir','f') {var $dir = field('\s*:\s*',1,last) var $cmd = concat('du -h ',quote($dir,'x')) report cn_db_size prefix {write '---+ Database Size Information' write '---## Using: ',encode($cmd) } call writeCommand(concat('du -h ',quote($dir,'x'))) if isCreated(true) toc $det,':[[',getFile(),'][rda_report][Database Size]]' } } =head2 cn_db_env - Database Environment Gathers monitor database environment information. =cut debug ' - gathering database environment information' var $cmd = concat(\ $pgm,' -X -Z -p ',$ADMIN_PORT,' -D "',$DIR_MANAGER,'" --bindPasswordFile ',\ $bnd,' -b "cn=userRoot Database Environment,cn=monitor" objectclass=*') call exec_ldapsearch(\ [$det,'cn_db_env','Database Environment Information',\ 'Database Environment'],\ $cmd,$pre) =head2 cn_uesrroot_backend - User Root Backend Information Gathers monitor user root backend information. =cut debug ' - gathering user root backend information' var $cmd = concat(\ $pgm,' -X -Z -p ',$ADMIN_PORT,' -D "',$DIR_MANAGER,'" --bindPasswordFile ',\ $bnd,' -b "cn=userRoot Backend,cn=monitor" objectclass=*') call exec_ldapsearch(\ [$det,'cn_uesrroot_backend','User Root Backend Information'],$cmd,$pre) if $pre {unpretoc call setPrefix($PRE) } } unpretoc 2 } =head1 JAVA TOOLS INFORMATION Gathers Oracle Unified Directory-related information using Java tools. =head2 jinfo - Java Information Gathers F command output (UNIX only). =cut pretoc '%SPLIT%' pretoc '1+:Java Tools Information' var $pid = first(grepFile(catFile($OUD,'logs','server.pid'),'.*')) var ($cur,$det,$max,$pre) = (0,2,1) if exists($MNU{'JAVA_STAT'}) var ($det,$max,$pre) = (3,$LOOP,true) else debug ' Inside OUD module, gathering Java tools information' while expr('<',$cur,$max) {if and($cur,$SLEEP) {debug ' Inside OUD module, sleeping ',$SLEEP,' seconds' sleep $SLEEP } incr $cur if $pre {debug ' Inside OUD module, gathering Java tools info (sample ',$cur,')' call setPrefix(concat($PRE,'cnt_',$cur)) pretoc '2:Iteration ',$cur } if and(isUnix(),testFile($MOD,catFile($JDK_HOME,'bin',${AS.EXE:'jinfo'}))) {debug ' - gathering Java information' var $cmd = concat(lastCommand(),' ',$pid) report jinfo prefix {write '---+ Java Information' write '---## Using: ',encode($cmd) if $pre write '---### Executed at: ',${RDA.GMTIME},' UTC' } call writeCommand($cmd) if isCreated(true) {write $TOP toc $det,':[[',getFile(),'][rda_report][Java Information]]' } } =head2 jmap_heap - Heap Space Information Gathers heap space information using F command (UNIX only). =cut if testFile($MOD,catFile($JDK_HOME,'bin',${AS.EXE:'jmap'})) {var $pgm = lastCommand() if isUnix() {debug ' - gathering heap space information' var $cmd = concat($pgm,' -heap ',$pid) report jmap_heap prefix {write '---+ Heap Space Information' write '---## Using: ',encode($cmd) if $pre write '---### Executed at: ',${RDA.GMTIME},' UTC' } call writeCommand($cmd) if isCreated(true) {write $TOP toc $det,':[[',getFile(),'][rda_report][Heap Space Information]]' } } =head2 jmap_histo - Histo Information Gathers histo information using F command. =cut debug ' - gathering histo information' var $cmd = concat($pgm,' -histo ',$pid) report jmap_histo prefix {write '---+ Histo Information' write '---## Using: ',encode($cmd) if $pre write '---### Executed at: ',${RDA.GMTIME},' UTC' } call writeCommand($cmd) if isCreated(true) {write $TOP toc $det,':[[',getFile(),'][rda_report][Histo Information]]' } } =head2 jstat - Java Statistics Information Gathers F command output. =cut if testFile($MOD,catFile($JDK_HOME,'bin',${AS.EXE:'jstat'})) {debug ' - gathering Java statistics information' var $cmd = concat(lastCommand(),' -gc ',$pid,' 1000 10') report jstat prefix {write '---+ Java Statistics Information' write '---## Using: ',encode($cmd) if $pre write '---### Executed at: ',${RDA.GMTIME},' UTC' } call writeCommand($cmd) if isCreated(true) {write $TOP toc $det,':[[',getFile(),'][rda_report][Java Statistics Information]]' } } if $pre {unpretoc call setPrefix($PRE) } } unpretoc 2 =head1 HANG CAPTURE Gathers instance hang-related information in advanced mode. =cut if and($ADVANCED,exists($MNU{'INSTANCE_HANG'})) {pretoc '%SPLIT%' pretoc '1+:Hang Capture' # Determine the command path if or(${OS.linux},${OS.solaris}) var $PSTACK = findCommand('pstack') if ${OS.solaris} var $PRSTAT = findCommand('prstat') if testFile($MOD,catFile($JDK_HOME,'bin',${AS.EXE:'jstack'})) var $JSTACK = lastCommand() var $cur = 0 while expr('<',$cur,$LOOP) {if and($cur,$SLEEP) {debug ' Inside OUD module, sleeping ',$SLEEP,' seconds' sleep $SLEEP } incr $cur call setPrefix(concat($PRE,'cnt_',$cur)) pretoc '2:Iteration ',$cur debug ' Inside OUD module, collecting hang capture (sample ',$cur,')' =head2 pstack - pstack Output Gathers C command output (applies to Linux and Solaris only). =cut if ?$PSTACK {debug ' - gathering pstack output' var $cmd = concat($PSTACK,' ',$pid) report pstack prefix {write '---+ pstack Output' write '---## Using: ',encode($cmd) write '---### Executed at: ',${RDA.GMTIME},' UTC' } call writeCommand($cmd) if isCreated(true) {write $TOP toc '3:[[',getFile(),'][rda_report][pstack Output]]' } } =head2 prstat - prstat Output Gathers C command output (applies to Solaris only). =cut if ?$PRSTAT {debug ' - gathering prstat output' var $cmd = concat($PRSTAT,' -L -p ',$pid) report prstat prefix {write '---+ prstat Output' write '---## Using: ',encode($cmd) write '---### Executed at: ',${RDA.GMTIME},' UTC' } call writeCommand($cmd) if isCreated(true) {write $TOP toc '3:[[',getFile(),'][rda_report][prstat Output]]' } } =head2 jstack - jstack Output Gathers C command output. =cut if ?$JSTACK {debug ' - gathering jstack output' var $cmd = concat($JSTACK,' -l ',$pid) report jstack prefix {write '---+ jstack Output' write '---## Using: ',encode($cmd) write '---### Executed at: ',${RDA.GMTIME},' UTC' } call writeCommand($cmd) if isCreated(true) {write $TOP toc '3:[[',getFile(),'][rda_report][jstack Output]]' } } unpretoc call setPrefix($PRE) } unpretoc 2 } # Unlink the temporary files call unlinkTemp('ADMIN') call unlinkTemp('BIND') unpretoc =head1 SEE ALSO L =begin credits =over 10 =item RDA 4.29: Olivier Rivat. =back =end credits =head1 COPYRIGHT NOTICE Copyright (c) 2002, 2012, 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