# MCclu.ctl:230: Collects Cluster High Availability Software Information # $Id: MCclu.ctl,v 1.22 2016/02/11 08:20:05 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/EXPLORER/MCclu.ctl,v 1.22 2016/02/11 08:20:05 RDA Exp $ # # Change History # 20160211 MM initialize $osv =head1 NAME EXPLORER:MCclu - Collects Cluster High Availability Software Information =head1 DESCRIPTION This module collects Cluster High Availability software information. The following reports can be generated and are regrouped under C: =cut use Buffer use Mrc # Initialization var $VALIDATE = true keep $VALIDATE section begin var $ERR = '---## Associated Errors' var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' var $WRN = ' * Links point to files that have been collected in their \ original format. Opening them directly in your browser can \ present risks. To prevent them, access the file outside the \ browser or use the link to save them and use an adequate \ viewer.' run EXPLORER:XPLRlib('cluster') #------------------------------------------------------------------------------ # XPLR_cluster section #------------------------------------------------------------------------------ section XPLR_cluster var $osv = get_osv() # Defined the macro to add Cluster Private Interconnect collections macro add_common_sci_collections {var (\@cmd,\@fil) = @arg loop $idx (0,1) call push(@cmd,\ [concat('cluster/sci/scidstat-su_',$idx),\ '/opt/SUNWscid/bin/scidstat',concat('-su ',$idx),\ concat('---+ SCI Card ',$idx,' Status')]) call push(@cmd,\ ['cluster/sci/sciadm-ident',\ '/opt/SUNWsci/bin/sciadm','-ident',\ '---+ SCI Cards Information'],\ ['cluster/sci/sciinfo-a',\ '/opt/SUNWsci/bin/sciinfo','-a',\ '---+ SCI Scrubber Jumper Settings']) call push(@fil,\ ['cluster/etc/sci.ifconf','/etc/sci.ifconf'],\ ['cluster/etc/sma.config','/etc/sma.config'],\ ['cluster/etc/sma.ip','/etc/sma.ip']) } # Defined the macro to perform commands collection macro do_collect_commands {var ($rpt,$ttl,$lvl,$lnk,\@cmd) = @arg import $TOC keep $TOC report $rpt title '---+!! ',$ttl title $TOC call do_exec(@cmd) if isCreated(true) toc $lvl,':[[',getFile(),'][rda_report][',$lnk,']]' } # Defined the macro to perform file collection macro do_collect_files {var ($rpt,$ttl,$lvl,$lnk,\@fil) = @arg import $TOP,$WRN keep $TOP,$WRN report $rpt prefix {write '---+!! ',$ttl write $WRN write '|*File Path*| *Size*|*Last Modified Date*|' } call do_collect_fil(@fil) if hasOutput(true) write $TOP if isCreated(true) toc $lvl,':[[',getFile(),'][rda_report][',$lnk,']]' } =head1 CACAO SOFTWARE COLLECTIONS Gathers Cacao 1.x (C) and Cacao 2.x (C) information =cut # Define the macro to collect Cacao software information macro collect_cacao {var ($ver,$bas,@cmd,@fil,@log) = (0) loop $pkg ('SUNWcacao','SUNWcacaort') {if is_pkg_installed($pkg) {# Obtain Cacao base directory if compare('eq',$pkg,'SUNWcacao') var $bas = get_pkg_base($pkg,$pkg,'bin') else var $bas = get_pkg_base($pkg,'usr','lib','cacao','bin') # Obtain Cacao version if or(and(compare('eq',$pkg,'SUNWcacao'),\ $bas,\ is_pkg_installed('SUNWcacaocfg'),\ testFile('x',catFile($bas,'cacaoadm'))),\ and(compare('eq',$pkg,'SUNWcacaort'),\ $bas,\ testFile('x',catFile($bas,'cacaoadm')))) {var ($ver) = command(join(' ',catCommand($bas,'cacaoadm'),'-V',\ '2>/dev/null')) var $ver = field(',',0,$ver) } =head2 clu_cmd_cac - Cacao Software Information Gathers Cacao 1.x software information using the following commands: =over 2 =item o C =item o C =item o C =item o C =item o C =back Gathers Cacao 2.x software information using the following commands: =over 2 =item o C =item o C =item o C =item o C =item o C =back =cut if $ver {# Add Cacao commands call push(@cmd,\ {cmd => 'TITLE',\ txt => concat('---+ ',$pkg,' Package Commands')},\ [join('/','cacao',$ver,'cacaoadm_list-modules'),\ catFile($bas,'cacaoadm'),'list-modules',\ '---++ Common Agent Container Module List'],\ [join('/','cacao',$ver,'cacaoadm_status'),\ catFile($bas,'cacaoadm'),'status',\ '---++ Common Agent Container Module Status'],\ [join('/','cacao',$ver,'cacaoadm-V'),\ catFile($bas,'cacaoadm'),'-V',\ '---++ Common Agent Container Version'],\ [join('/','cacao',$ver,'keytool-list_truststore'),\ '/usr/bin/keytool',\ concat('-list -keystore ',\ cond(compare('eq',$pkg,'SUNWcacao'),\ '/etc/opt/SUNWcacao/security/jsse/truststore',\ '/etc/cacao/instances/default/security/jsse/truststore')),\ concat('---++ Contents of ',\ cond(compare('eq',$pkg,'SUNWcacao'),\ '/etc/opt/SUNWcacao/security/jsse/truststore',\ '/etc/cacao/instances/default/security/jsse/truststore'),\ ' Keystore'),\ {det => concat('echo trustpass | /usr/bin/keytool -list -keystore ',\ cond(compare('eq',$pkg,'SUNWcacao'),\ '/etc/opt/SUNWcacao/security/jsse/truststore',\ '/etc/cacao/instances/default/security/jsse/truststore')),\ req => {inp => "trustpass\012",\ pre => "echo 'trustpass' |"}}],\ {cmd => 'UNTITLE'}) =head2 clu_cfg_cac - Cacao Configuration Files Collects the Cacao 1.x configuration files: =over 2 =item o F (recursive) =item o F =back Collects the Cacao 2.x configuration files: =over 2 =item o F (recursive) =back =cut # Add Cacao config files if compare('eq',$pkg,'SUNWcacao') call push(@fil,\ [join('/','cacao',$ver,'etc','opt','SUNWcacao'),\ '/etc/opt/SUNWcacao',true],\ [join('/','cacao',$ver,'var','opt','SUNWcacao','run'),\ '/var/opt/SUNWcacao/run',false]) else call push(@fil,[join('/','cacao',$ver,'etc','cacao'),'/etc/cacao',true]) =head2 clu_log_cac - Cacao Log Files Collects the latest 1000000 bytes the following Cacao 1.x log files: =over 2 =item o F =item o F =back Collects the latest 1000000 bytes the following Cacao 2.x log files: =over 2 =item o F =item o F =item o F =back =cut # Add Cacao log files if or(defined(testDir('d','/etc/cluster')),\ is_pkg_installed('SUNWesmportal')) {if compare('eq',$pkg,'SUNWcacao') {call push(@log,\ {cmd => 'END',\ cnt => 1000000,\ fil => '/var/opt/SUNWcacao/logs/cacao.0',\ nam => join('/','cacao',$ver,'cacao.0.log')},\ {cmd => 'END',\ cnt => 1000000,\ fil => '/var/opt/SUNWcacao/logs/instrum-cacao.0',\ nam => join('/','cacao',$ver,'instrum-cacao.0.log')}) } else {call push(@log,\ {cmd => 'END',\ cnt => 1000000,\ fil => '/var/cacao/instances/default/audits/audit-cacao.0',\ nam => join('/','cacao',$ver,'audit-cacao.0.log')},\ {cmd => 'END',\ cnt => 1000000,\ fil => '/var/cacao/instances/default/logs/cacao.0',\ nam => join('/','cacao',$ver,'cacao.0.log')},\ {cmd => 'END',\ cnt => 1000000,\ fil => '/var/cacao/instances/default/logs/instrum-cacao.0',\ nam => join('/','cacao',$ver,'instrum-cacao.0.log')}) } } } } } debug ' Inside CLU collection, collecting Cacao information' pretoc '3:Cacao Software' call do_collect_commands('clu_cmd_cac','Cacao Commands','4','Commands',\@cmd) debug ' Inside CLU collection, collecting Cacao configuration files' call do_collect_files('clu_cfg_cac','Cacao Configuration Files','4',\ 'Configuration Files',\@fil) debug ' Inside CLU collection, collecting Cacao log files' call do_collect_files('clu_log_cac','Cacao Log Files','4',\ 'Log Files',\@log) # Adjust the table of content unpretoc } =head1 SUN CLUSTER 1.X COLLECTIONS =head2 clu_cmd_1x - Sun Cluster 1.x Information Gathers Sun Cluster 1.x software information using the following commands: =over 2 =item o C =back =head2 clu_cfg_1x - Sun Cluster 1.x Configuration Files Gathers the following Sun Cluster 1.x configuration files: =over 2 =item o F =item o F =item o F =item o F =item o F =item o F (recursive) =item o F (recursive) =item o F (recursive - excluding /var/opt/oracle/nlsdata) =item o F (recursive) =item o F (recursive - excluding /var/opt/SUNWcluster/photon) =item o F (recursive - excluding /var/opt/SUNWhadf/hadf/nfs_probe_mountpoints) =back =cut # Define the macro to collect Sun Cluster 1.x specific information macro collect_1x {import @MCM var @fil = () call push(@fil,\ ['cluster/rhosts','/.rhosts'],\ ['cluster/etc/pnmconfig','/etc/pnmconfig'],\ ['cluster/etc/sci.ifconf','/etc/sci.ifconf'],\ ['cluster/etc/sma.config','/etc/sma.config'],\ ['cluster/etc/sma.ip','/etc/sma.ip'],\ ['cluster/var/opt/informix','/var/opt/informix',true],\ ['cluster/var/opt/sybase','/var/opt/sybase',true]) # Add recursive directory collections excluding specific files/directories loop $dir ('/etc/opt/SUNWhadf','/var/opt/oracle','/var/opt/SUNWcluster',\ '/var/opt/SUNWhadf') {loop $fil (grepDir($dir,'.*','dr')) {next match($fil,'/etc/opt/SUNWcluster/conf/hanfs/\.nfs_probe_mountpoints|\ /var/opt/oracle/nlsdata|\ /var/opt/SUNWcluster/photon|\ /var/opt/SUNWhadf/hadf/nfs_probe_mountpoints') if ?testFile('fT',$fil) call push(@fil,[join('/','cluster',$fil),$fil]) } } # Perform Sun Cluster 1.x collections pretoc '3:Cluster Versions 1.x' debug ' Inside CLU collection, collecting Sun Cluster 1.x information' call do_collect_commands('clu_cmd_1x','Sun Cluster 1.x Commands','4',\ 'Commands',\@MCM) debug ' Inside CLU collection, collecting Sun Cluster 1.x configuration files' call do_collect_files('clu_cfg_1x','Sun Cluster 1.x Configuration Files','4',\ 'Configuration Files',\@fil) # Adjust the table of content unpretoc } =head1 SUN CLUSTER 2.X COLLECTIONS =head2 clu_cmd_2x_cfg - Sun Cluster 2.x Configuration Information Gathers Sun Cluster 2.x software configuration information using the following commands: =over 2 =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =back Executes the following command for each disk found with the C command: =over 2 =item o C =back =head2 clu_cmd_2x_run - Sun Cluster 2.x Run-Time Information Gathers Sun Cluster 2.x software run-time information using the following commands: =over 2 =item o C =item o C =item o C =item o C =item o C =item o C =item o C =back The cluster name is obtained from the F file. =head2 clu_cfg_2x - Sun Cluster 2.x Configuration Files Gathers the following Sun Cluster 2.x configuration files: =over 2 =item o F =item o F (recursive - excluding F) =item o F =item o F =item o F =item o F =item o F =item o F =item o F (recursive - excluding F, F, and F) =item o F =back The cluster name is obtained from the F file. =cut # Define the macro to collect Sun Cluster 2.x specific information macro collect_2x {import @MCM,@MFI,%FLG var ($pkg,$pnu,$pre,@cmd,@fil,@rcm) = (get_pkg_version('SUNWsc')) call log_info('Collecting Sun Cluster 2.x Configuration and Run-Time info...') # Add run-time collections if $FLG{'scrunning'} {call log_info('Cluster is running on this node') call push(@rcm,\ ['cluster/config/scconf-p',\ '/opt/SUNWcluster/bin/scconf',concat(quote($FLG{'scname'}),' -p'),\ concat('---+ Cluster ',$FLG{'scname'},' Configuration Parameters')],\ ['cluster/config/clustm-dumpstate',\ '/opt/SUNWcluster/bin/clustm',concat('dumpstate ',quote($FLG{'scname'})),\ concat('---+ Cluster ',$FLG{'scname'},' Dump State')],\ ['cluster/config/hastat',\ '/opt/SUNWcluster/bin/hastat',undef,\ '---+ Configuration Status'],\ ['cluster/config/get_node_status',\ '/opt/SUNWcluster/bin/get_node_status',undef,\ '---+ Node Status']) # Verify appropriate patch is installed prior to collecting PMF output if $pkg {($pnu,$pre) = cond(compare('eq',$pkg,'2.1'),list('105458','17'),\ compare('eq',$pkg,'2.2'),\ cond(expr('==',$FLG{'osv'},'6'),list('109208','08'),\ expr('==',$FLG{'osv'},'7'),list('109209','08'),\ expr('==',$FLG{'osv'},'8'),list('109210','07'))) if $pnu {var $flg = 0 loop $ptc (command('/usr/bin/pkgparam SUNWsc PATCHLIST 2>/dev/null')) {var ($num,$rev) = split('-',$ptc,2) next !and(compare('eq',$num,$pnu),compare('ge',$rev,$pre)) var $flg = 1 break } if $flg call push(@rcm,\ ['cluster/config/pmfadm-l','/opt/SUNWcluster/bin/pmfadm','-l ""',\ '---+ Status Information']) else call log_info(concat('Patch ',$pnu,'-',$pre,' is not installed. ',\ 'Skipping pmfadm -l collection')) } } call push(@rcm,\ ['cluster/config/pnmstat-l',\ '/opt/SUNWpnm/bin/pnmstat','-l',\ '---+ Status of Registered NAFO Groups'],\ ['cluster/config/hareg',\ '/opt/SUNWcluster/bin/hareg',undef,\ '---+ Sun Cluster Data Services']) } else call log_info('Cluster is NOT running on this node') # Add non-run-time collections call push(@cmd,\ ['cluster/var/opt/SUNWcluster/ls-l_devices',\ ${CMD.LS:'ls'},'-l /var/opt/SUNWcluster/devices',\ '---+ Contents of /var/opt/SUNWcluster/devices Directory'],\ {cmd => 'TITLE',\ txt => '---+ Disks Status'}) loop $dsk (grepDir('/dev/rdsk','^\.+$','nv')) {if match($dsk,'(.*)t.*$') var $tbl{last} = last else var $tbl{$dsk} = $dsk } loop $dsk (keys(%tbl,'KA')) call push(@cmd,\ [concat('cluster/config/scssa_inq_',$dsk),\ '/opt/SUNWcluster/bin/finddevices',concat('disks ',quote($dsk)),\ concat('---++ Disk ',$dsk,' Status')]) call push(@cmd,\ {cmd => 'UNTITLE'}) # Add Cluster Private Interconnect info if is_pkg_installed('SUNWsci') {call push(@cmd,\ ['cluster/sci/smactl-l',\ '/opt/SUNWsma/bin/smactl','-l',\ '---+ Interconnectivity Information'],\ ['cluster/sci/get_ci_status',\ '/opt/SUNWsma/bin/get_ci_status',undef,\ '---+ Interconnectivity Status']) call add_common_sci_collections(\@cmd,\@fil) } # Add the default collections call push(@cmd,@MCM) call push(@fil,@MFI) call push(@fil,\ ['cluster/config/rhosts','/.rhosts'],\ ['cluster/etc/pnmconfig','/etc/pnmconfig'],\ ['cluster/config/init.snmpd','/opt/SUNWcluster/bin/init.snmpd']) # Add recursive directory collections excluding specific files/directories loop $dir ('/etc/opt/SUNWcluster/conf','/var/opt/SUNWcluster') {loop $fil (grepDir($dir,'.*','dr')) {next match($fil,\ concat('/etc/opt/SUNWcluster/conf/hanfs/\.nfs_probe_mountpoints|\ /var/opt/SUNWcluster/photon|\ /var/opt/SUNWcluster/devices|\ /var/opt/SUNWcluster/',$FLG{'scname'})) if ?testFile('fT',$fil) call push(@fil,[join('/','cluster',$fil),$fil]) } } pretoc '3:Cluster Versions 2.x' pretoc '4:Commands' debug ' Inside CLU collection, collecting Sun Cluster 2.x configuration',\ ' information' call do_collect_commands('clu_cmd_2x_cfg',\ 'Sun Cluster 2.x Configuration Commands','5',\ 'Configuration',\@cmd) if $FLG{'scrunning'} {debug ' Inside CLU collection, collecting Sun Cluster 2.x run-time',\ ' information' call do_collect_commands('clu_cmd_2x_run',\ 'Sun Cluster 2.x Run-Time Commands','5','Run-Time',\@rcm) } # Adjust the table of content unpretoc debug ' Inside CLU collection, collecting Sun Cluster 2.x configuration',\ ' files' call do_collect_files('clu_cfg_2x','Sun Cluster 2.x Configuration Files','4',\ 'Configuration Files',\@fil) # Adjust the table of content unpretoc } =head1 SUN CLUSTER 3.X COLLECTIONS =head2 clu_cmd_3x_cfg - Sun Cluster 3.x Configuration Information Gathers Sun Cluster 3.x software configuration information using the following commands: =over 2 =item o C> =item o C =item o C> =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C> =item o C =back =head2 clu_cmd_3x_run - Sun Cluster 3.x Run-Time Information Gathers Sun Cluster 3.x software run-time information using the following commands: =over 2 =item o C (Oracle Solaris 10 and later) =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =back Collects the following command for each Cluster Service (SVC) returned by the C command: =over 2 =item o C (Oracle Solaris 10 and later) =back Collects the following command for each Tag name (TAG) returned by the C command: =over 2 =item o C =back Collects the following commands for each Zone Cluster (ZC) returned by the C command: =over 2 =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =back =head2 clu_cfg_3x - Sun Cluster 3.x Configuration Files Gathers the following Sun Cluster 3.x configuration files: =over 2 =item o F (recursive) =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F (Oracle Solaris 10 and later) =back =head2 clu_log_3x - Sun Cluster 3.x Log Files Gathers the following Sun Cluster 3.x log files: =over 2 =item o F (recursive - excluding directories named C, C, C and files named C, C, C, C) =item o F =back =cut # Define the macro to collect Sun Cluster 3.x specific information macro collect_3x {import @MCM,@MFI,%FLG var (@cmd,@fil,@log,@rcm,%cmo,%pgo,%reo,%sco) = () call log_info('Collecting Sun Cluster 3.x Configuration and Run-Time info...') # Add run-time collections if $FLG{'scrunning'} {var $clu = testFile('x','/usr/cluster/bin/cluster') call log_info('Cluster is running on this node') if grepCommand('/usr/cluster/bin/pmfadm -L 2>/dev/null','\:\s*(.*)$','1') {loop $tag (split('\s',last)) call push(@rcm,\ [concat('cluster/config/pmfadm-l.',$tag),'/usr/cluster/bin/pmfadm',\ concat('-l ',quote($tag)),concat('---+ Tag ',$tag, ' Status')]) } call push(@rcm,\ ['cluster/config/scstat',\ '/usr/cluster/bin/scstat',undef,\ '---+ Cluster Components Status'],\ ['cluster/config/scstat-pv',\ '/usr/cluster/bin/scstat','-pv',\ '---+ Cluster Components Status (Verbose I)'],\ ['cluster/config/scstat-pvv',\ '/usr/cluster/bin/scstat','-pvv',\ '---+ Cluster Components Status (Verbose II)'],\ ['cluster/config/scrgadm-pv',\ '/usr/cluster/bin/scrgadm','-pv',\ '---+ Cluster Configuration Information (Verbose I)'],\ ['cluster/config/scrgadm-pvv',\ '/usr/cluster/bin/scrgadm','-pvv',\ '---+ Cluster Configuration Information (Verbose II)'],\ ['cluster/config/scconf-pv',\ '/usr/cluster/bin/scconf','-pv',\ '---+ Cluster Current Configuration'],\ ['cluster/config/scconf-pvv',\ '/usr/cluster/bin/scconf','-pvv',\ '---+ Cluster Current Configuration (Verbose II)'],\ ['cluster/config/scversions',\ '/usr/cluster/bin/scversions',undef,\ '---+ Cluster Versions']) if $clu call push(@rcm,\ ['cluster/config/cluster-list-checks',\ '/usr/cluster/bin/cluster',\ 'list-checks','---+ Cluster Check Information'],\ ['cluster/config/cluster-list-checks-v',\ '/usr/cluster/bin/cluster',\ 'list-checks -v','---+ Cluster Check Information (Verbose)'],\ ['cluster/config/cluster-list-cmds',\ '/usr/cluster/bin/cluster',\ 'list-cmds','---+ Cluster Commands'],\ ['cluster/config/cluster-check-v',\ '/usr/cluster/bin/cluster','check -v',\ '---+ Cluster Configuration Check (Verbose)'],\ ['cluster/config/cluster-export-xml',\ '/usr/cluster/bin/cluster','export',\ '---+ Cluster Configuration Export'],\ ['cluster/config/cluster-list-v',\ '/usr/cluster/bin/cluster','list -v',\ '---+ Cluster List (Verbose)'],\ ['cluster/config/clinfo-n',\ '/usr/sbin/clinfo','-n',\ '---+ Cluster Node Information'],\ ['cluster/config/clnode-list-v',\ '/usr/cluster/bin/clnode','list -v',\ '---+ Cluster Nodes'],\ ['cluster/config/clnode-show',\ '/usr/cluster/bin/clnode','show',\ '---+ Cluster Nodes Configuration'],\ ['cluster/config/clnode-status-v',\ '/usr/cluster/bin/clnode','status -v',\ '---+ Cluster Nodes Status'],\ ['cluster/config/cluster-status-v',\ '/usr/cluster/bin/cluster','status -v',\ '---+ Cluster Zone Components Status (Verbose)'],\ ['cluster/config/cluster-show',\ '/usr/cluster/bin/cluster','show',\ '---+ Cluster Zone, Nodes, Resource Groups, Types and Properties'],\ ['cluster/config/cluster-show-v',\ '/usr/cluster/bin/cluster','show -v',\ '---+ Cluster Zone, Nodes, Resource Groups, Types and Properties \ (Verbose)'],\ ['cluster/config/cldg-list-v',\ '/usr/cluster/bin/cldg','list -v',\ '---+ Device Groups'],\ ['cluster/config/cldg-show',\ '/usr/cluster/bin/cldg','show',\ '---+ Device Groups Configuration'],\ ['cluster/config/cldg-show-v',\ '/usr/cluster/bin/cldg','show -v',\ '---+ Device Groups Configuration (Verbose)'],\ ['cluster/config/cldg-status-v',\ '/usr/cluster/bin/cldg','status -v',\ '---+ Device Groups Status'],\ ['cluster/config/cldev-list-v',\ '/usr/cluster/bin/cldev','list -v',\ '---+ Device Paths'],\ ['cluster/config/cldev-show-v',\ '/usr/cluster/bin/cldev','show -v',\ '---+ Device Paths Configuration'],\ ['cluster/config/cldev-status-v',\ '/usr/cluster/bin/cldev','status -v',\ '---+ Device Paths Status']) if ?testFile('x','/usr/cluster/bin/scdpm') call push(@rcm,\ ['cluster/config/scdpm-p-all-all',\ '/usr/cluster/bin/scdpm','-p all:all',\ '---+ Disk Paths and Their Status']) if $clu call push(@rcm,\ ['cluster/config/clintr-show',\ '/usr/cluster/bin/clintr','show',\ '---+ Interconnect Components Configuration'],\ ['cluster/config/clintr-status',\ '/usr/cluster/bin/clintr','status',\ '---+ Interconnect Components Status'],\ ['cluster/config/clrslh-list-v',\ '/usr/cluster/bin/clrslh','list -v',\ '---+ Logical Hostnames'],\ ['cluster/config/claccess-list-v',\ '/usr/cluster/bin/claccess','list -v',\ '---+ Machines with Permission to Access Cluster Configuration'],\ ['cluster/config/claccess-show',\ '/usr/cluster/bin/claccess','show',\ '---+ Machines with Permission to Access Cluster Configuration Including \ Protocol'],\ ['cluster/config/clnas-list-v',\ '/usr/cluster/bin/clnas','list -v',\ '---+ NAS Devices'],\ ['cluster/config/clnas-show',\ '/usr/cluster/bin/clnas','show',\ '---+ NAS Devices Configuration'],\ ['cluster/config/clnas-show-v',\ '/usr/cluster/bin/clnas','show -v',\ '---+ NAS Devices Configuration (Verbose)']) # Collect SMF specific data for Oracle Solaris 10 and later if expr('>=',$osv,'10') {call push(@rcm,\ {cmd => 'TITLE',\ txt => concat('---+ OS Release-Dependant Commands (5.',$osv,')')},\ ['cluster/smf/svcs-clust-p',\ '/usr/bin/svcs',concat('-a | ',${CMD.GREP:'grep'},' cluster'),\ '---++ Cluster Services']) loop $svc (grepCommand('/usr/bin/svcs -a 2>/dev/null','cluster')) {$svc = field(':',0,field('svc:',1,$svc)) var $fil = replace(replace($svc,'\/',''),'\/','-',true) call push(@rcm,\ [concat('cluster/smf/xml/',$fil,'.xml'),\ '/usr/sbin/svccfg',concat('export svc:"',quote($svc),'"'),\ concat('---++ Cluster Service ',$svc,' Configuration'),true]) } call push(@rcm,{cmd => 'UNTITLE'}) call push(@fil,\ ['cluster/smf/method','/usr/cluster/lib/svc/method',false]) } if $clu call push(@rcm,\ ['cluster/config/clq-list-v',\ '/usr/cluster/bin/clq','list -v',\ '---+ Quorum Devices'],\ ['cluster/config/clq-show',\ '/usr/cluster/bin/clq','show',\ '---+ Quorum Devices Configuration'],\ ['cluster/config/clq-status-v',\ '/usr/cluster/bin/clq','status -v',\ '---+ Quorum Devices Status'],\ ['cluster/config/clrg-list-v',\ '/usr/cluster/bin/clrg','list -v',\ '---+ Resource Groups'],\ ['cluster/config/clrg-show',\ '/usr/cluster/bin/clrg','show',\ '---+ Resource Groups Configuration'],\ ['cluster/config/clrg-show-v',\ '/usr/cluster/bin/clrg','show -v',\ '---+ Resource Groups Configuration (Verbose)'],\ ['cluster/config/clrg-status-v',\ '/usr/cluster/bin/clrg','status -v',\ '---+ Resource Groups Status'],\ ['cluster/config/clrt-list-v',\ '/usr/cluster/bin/clrt','list -v',\ '---+ Resource Types'],\ ['cluster/config/clrs-list-v',\ '/usr/cluster/bin/clrs','list -v',\ '---+ Resources'],\ ['cluster/config/clrs-show',\ '/usr/cluster/bin/clrs','show',\ '---+ Resources Configuration'],\ ['cluster/config/clrs-show-v',\ '/usr/cluster/bin/clrs','show -v',\ '---+ Resources Configuration (Verbose)'],\ ['cluster/config/clrs-status-v',\ '/usr/cluster/bin/clrs','status -v',\ '---+ Resources Status'],\ ['cluster/config/clrssa-list-v',\ '/usr/cluster/bin/clrssa','list -v',\ '---+ Shared-Address Resources'],\ ['cluster/config/clsnmphost-list-v',\ '/usr/cluster/bin/clsnmphost','list -v',\ '---+ Simple Network Management Protocol Hosts'],\ ['cluster/config/clsnmphost-show',\ '/usr/cluster/bin/clsnmphost','show',\ '---+ Simple Network Management Protocol Hosts Configuration'],\ ['cluster/config/clsnmphost-show-v',\ '/usr/cluster/bin/clsnmphost','show -v',\ '---+ Simple Network Management Protocol Hosts Configuration (Verbose)'],\ ['cluster/config/clsnmpmib-list-v',\ '/usr/cluster/bin/clsnmpmib','list -v',\ '---+ Simple Network Management Protocol Management Information Bases'],\ ['cluster/config/clsnmpmib-show',\ '/usr/cluster/bin/clsnmpmib','show',\ '---+ Simple Network Management Protocol Management Information Bases \ Configuration'],\ ['cluster/config/clsnmpuser-list-v',\ '/usr/cluster/bin/clsnmpuser','list -v',\ '---+ Simple Network Management Protocol Users'],\ ['cluster/config/clsnmpuser-show',\ '/usr/cluster/bin/clsnmpuser','show',\ '---+ Simple Network Management Protocol Users Configuration']) call push(@rcm,\ ['cluster/config/pnmstat-lm',\ '/usr/cluster/bin/pnmstat','-lm',\ '---+ Status of Registered NAFO Groups']) if $clu call push(@rcm,\ ['cluster/config/clta-print',\ '/usr/cluster/bin/clta','print',\ '---+ Telemetry Attributes System Resource Usage'],\ ['cluster/config/clta-print-v',\ '/usr/cluster/bin/clta','print -v',\ '---+ Telemetry Attributes System Resource Usage (Verbose)'],\ ['cluster/config/clta-show-v',\ '/usr/cluster/bin/clta','show -v',\ '---+ Telemetry Attributes Configuration'],\ ['cluster/config/clta-status-v',\ '/usr/cluster/bin/clta','status -v',\ '---+ Telemetry Attributes Status']) if ?testFile('x','/usr/cluster/bin/clzc') {call push(@rcm,\ ['cluster/config/clzc-list-v',\ '/usr/cluster/bin/clzc','list -v',\ '---+ Zone Clusters'],\ ['cluster/config/clzc-show',\ '/usr/cluster/bin/clzc','show',\ '---+ Zone Clusters Configuration'],\ ['cluster/config/clzc-show-v',\ '/usr/cluster/bin/clzc','show -v',\ '---+ Zone Clusters Configuration (Verbose)'],\ ['cluster/config/clzc-status',\ '/usr/cluster/bin/clzc','status',\ '---+ Zone Clusters Status']) loop $zon (command('/usr/cluster/bin/clzc list 2>/dev/null')) {var $arg = quote($zon) call push(@rcm,\ {cmd => 'TITLE',\ txt => concat('---+ Zone Cluster ',$zon,' ')},\ [concat('cluster/config/zonecluster/',$zon,'/clnode-list-Z',$zon,'-v'),\ '/usr/cluster/bin/clnode',concat('list -Z ',$arg,' -v'),\ '---++ Cluster Nodes'],\ [concat('cluster/config/zonecluster/',$zon,'/clnode-show-Z',$zon),\ '/usr/cluster/bin/clnode',concat('show -Z ',$arg),\ '---++ Cluster Nodes Configuration'],\ [concat('cluster/config/zonecluster/',$zon,'/clrslh-list-Z',$zon,'-v'),\ '/usr/cluster/bin/clrslh',concat('list -Z ',$arg,' -v'),\ '---++ Logical Hostnames'],\ [concat('cluster/config/zonecluster/',$zon,'/clnas-list-Z',$zon,'-v'),\ '/usr/cluster/bin/clnas',concat('list -Z ',$arg,' -v'),\ '---++ NAS Devices'],\ [concat('cluster/config/zonecluster/',$zon,'/clnas-show-Z',$zon),\ '/usr/cluster/bin/clnas',concat('show -Z ',$arg),\ '---++ NAS Devices Configuration'],\ [concat('cluster/config/zonecluster/',$zon,'/clnas-show-Z',$zon,'-v'),\ '/usr/cluster/bin/clnas',concat('show -Z ',$arg,' -v'),\ '---++ NAS Devices Configuration (Verbose)'],\ [concat('cluster/config/zonecluster/',$zon,'/clrg-list-Z',$zon,'-v'),\ '/usr/cluster/bin/clrg',concat('list -Z ',$arg,' -v'),\ '---++ Resource Groups'],\ [concat('cluster/config/zonecluster/',$zon,'/clrg-show-Z',$zon),\ '/usr/cluster/bin/clrg',concat('show -Z ',$arg),\ '---++ Resource Groups Configuration'],\ [concat('cluster/config/zonecluster/',$zon,'/clrg-show-Z',$zon,'-v'),\ '/usr/cluster/bin/clrg',concat('show -Z ',$arg,' -v'),\ '---++ Resource Groups Configuration (Verbose)'],\ [concat('cluster/config/zonecluster/',$zon,'/clrg-status-Z',$zon,'-v'),\ '/usr/cluster/bin/clrg',concat('status -Z ',$arg,' -v'),\ '---++ Resource Groups Status'],\ [concat('cluster/config/zonecluster/',$zon,'/clrt-list-Z',$zon,'-v'),\ '/usr/cluster/bin/clrt',concat('list -Z ',$arg,' -v'),\ '---++ Resource Types'],\ [concat('cluster/config/zonecluster/',$zon,'/clrs-list-Z',$zon,'-v'),\ '/usr/cluster/bin/clrs',concat('list -Z ',$arg,' -v'),\ '---++ Resources'],\ [concat('cluster/config/zonecluster/',$zon,'/clrs-show-Z',$zon),\ '/usr/cluster/bin/clrs',concat('show -Z ',$arg),\ '---++ Resources Configuration'],\ [concat('cluster/config/zonecluster/',$zon,'/clrs-show-Z',$zon,'-v'),\ '/usr/cluster/bin/clrs',concat('show -Z ',$arg,' -v'),\ '---++ Resources Configuration (Verbose)'],\ [concat('cluster/config/zonecluster/',$zon,'/clrs-status-Z',$zon,'-v'),\ '/usr/cluster/bin/clrs',concat('status -Z ',$arg,' -v'),\ '---++ Resources Status'],\ [concat('cluster/config/zonecluster/',$zon,'/clrssa-list-Z',$zon,'-v'),\ '/usr/cluster/bin/clrssa',concat('list -Z ',$arg,' -v'),\ '---++ Shared-Address Resources'],\ [concat('cluster/config/zonecluster/',$zon,'/clzc-show_',$zon),\ '/usr/cluster/bin/clzc',concat('show ',$arg),\ '---++ Zone Clusters Configuration'],\ [concat('cluster/config/zonecluster/',$zon,'/clzc-show-v_',$zon),\ '/usr/cluster/bin/clzc',concat('show -v ',$arg),\ '---++ Zone Clusters Configuration (Verbose)'],\ [concat('cluster/config/zonecluster/',$zon,'/clzc-export_',$zon),\ '/usr/cluster/bin/clzc',concat('export ',$arg),\ '---++ Zone Clusters Export'],\ [concat('cluster/config/zonecluster/',$zon,'/clzc-status_',$zon),\ '/usr/cluster/bin/clzc',concat('status ',$arg),\ '---++ Zone Clusters Status'],\ {cmd => 'UNTITLE'}) } } } else call log_info('This node is currently not in the cluster') # Add non-run-time collections call push(@cmd,\ ['cluster/config/scinstall-pv','/usr/cluster/bin/scinstall','-pv',\ '---+ Cluster Software Release and Package Versioning']) # Collect existing core files information call push(@cmd,\ {cmd => 'TITLE',\ txt => '---+ Core Files'}) loop $fil (grepDir('/var/cluster/core','^core.*$','rn')) {next !?testFile('f',$fil) var $nam = basename($fil) call push(@cmd,\ [concat('cluster/var/cluster/core/',$nam,'-ls-lLd'),\ ${CMD.LS:'ls'},concat('-lLd ',quote($fil)),\ concat('---++ ',encode($fil),' Core File Information')],\ [concat('cluster/var/cluster/core/',$nam,'-file'),\ ${CMD.FILE:'file'},quote($fil),\ concat('---++ ',encode($fil),' Core File Type')],\ [concat('cluster/var/cluster/core/',$nam,'-pstack'),\ '/usr/proc/bin/pstack',quote($fil),\ concat('---++ ',encode($fil),' Core File Stack Trace')]) } call push(@cmd,{cmd => 'UNTITLE'}) # Collect eventlog files list call push(@cmd,\ ['cluster/var/cluster/logs/eventlog_ls_-l',\ ${CMD.LS:'ls'},'-l /var/cluster/logs/eventlog*',\ '---+ Eventlog Files List']) # Command replctl sends output to stderr var $tmp = getTemp('TMP') call command(concat('/usr/cluster/lib/sc/replctl >/dev/null 2>',quote($tmp))) var @rs1 = grepFile($tmp,'.') call push(@cmd,\ {cmd => 'ARRAY',\ det => '/usr/cluster/lib/sc/replctl',\ nam => concat('cluster/config/repctl.',cond(status(),'err','out')),\ tbl => \@rs1,\ ttl => '---+ High Availability Services'}) # Collect NAS specific information if ?testFile('x','/usr/cluster/bin/scnas') call push(@cmd,\ ['cluster/config/scnas-p',\ '/usr/cluster/bin/scnas','-p',\ '---+ NAS Devices']) if ?testFile('x','/usr/cluster/bin/scnasdir') call push(@cmd,\ ['cluster/config/scnasdir-p',\ '/usr/cluster/bin/scnasdir','-p',\ '---+ NAS Devices Directories']) # Command cmm_ctl sends output to stderr call command(concat('/usr/cluster/lib/sc/cmm_ctl -g >/dev/null 2>',\ quote($tmp))) var @rs2 = grepFile($tmp,'.') call push(@cmd,\ {cmd => 'ARRAY',\ det => '/usr/cluster/lib/sc/cmm_ctl -g',\ nam => concat('cluster/config/cmm_ctl-g.',cond(status(),'err','out')),\ tbl => \@rs2,\ ttl => '---+ Nodes Status'}) call unlinkTemp('TMP') # Collect reservation keys information var (@pgr,@scs) = () call push(@cmd,\ {cmd => 'TITLE',\ txt => '---+ Resevation Keys'}) loop $dev (grepCommand('/usr/cluster/bin/scdidadm -l -o fullname 2>/dev/null',\ '\/rdsk\/')) {var $dev = trim($dev) call push(@pgr,'',concat('pgre Reservationkey for ',$dev,': ')) call push(@scs,'',concat('scsi Reservationkey for ',$dev,': ')) loop $lin (command(concat('/usr/cluster/lib/sc/pgre -c pgre_inkeys -d ',\ quote($dev),' 2>/dev/null'))) call push(@pgr,$lin) loop $lin (command(concat('/usr/cluster/lib/sc/scsi -c inkeys -d ',\ quote($dev),' 2>/dev/null'))) call push(@scs,$lin) } call push(@cmd,\ {cmd => 'ARRAY',\ det => '/usr/cluster/lib/sc/pgre -c pgre_inkeys -d device',\ nam => 'cluster/pgre_keys.out',\ tbl => \@pgr,\ ttl => '---++ PGRE Reservation Keys'}) call push(@cmd,\ {cmd => 'ARRAY',\ det => '/usr/cluster/lib/sc/scsi -c inkeys -d device',\ nam => 'cluster/scsi3_keys.out',\ tbl => \@scs,\ ttl => '---++ SCSI Reservation Keys'}) call push(@cmd,{cmd => 'UNTITLE'}) # Add Cluster Private Interconnect info if is_pkg_installed('SUNWsci') call add_common_sci_collections(\@cmd,\@fil) # Add the default collections call push(@cmd,@MCM) call push(@fil,@MFI) call push(@fil,\ ['cluster/etc/cluster','/etc/cluster','','','^private_string(\.bak)?$',\ 'drv'],\ ['cluster/etc/inet/ntp.conf.cluster','/etc/inet/ntp.conf.cluster']) # Collect log files loop $fil (grepDir('/var/cluster','^\.+$','drv')) {next match($fil,'/explorers-gz/|/explorers\..?/|/cores/') next match(basename($fil),'^core.*$|^eventlog$|^eventlog\..*$') next !?testFile('fT',$fil) call push(@log,[join('/','cluster',$fil),$fil]) } # Get eventlog* files while size less than N_EVTLOG_SIZE var ($flg,$siz) = (false,${MOD.CLU.N_EVTLOG_SIZE}) var $rem = $siz loop $fil (grepDir('/var/cluster/logs','^eventlog.*$','tr')) {if ?testFile('fT',$fil) {if expr('>=',$rem = expr('-',$rem,getSize($fil)),0) {call push(@log,[join('/','cluster',$fil),$fil]) var $flg = true } else var $rem = expr('+',$rem,getSize($fil)) } } pretoc '3:Cluster Versions 3.x' pretoc '4:Commands' debug ' Inside CLU collection, collecting Sun Cluster 3.x configuration',\ ' information' call do_collect_commands('clu_cmd_3x_cfg',\ 'Sun Cluster 3.x Configuration Commands','5',\ 'Configuration',\@cmd) if $FLG{'scrunning'} {debug ' Inside CLU collection, collecting Sun Cluster 3.x run-time',\ ' information' call do_collect_commands('clu_cmd_3x_run',\ 'Sun Cluster 3.x Run-Time Commands','5','Run-Time',\@rcm) } # Adjust the table of content unpretoc debug ' Inside CLU collection, collecting Sun Cluster 3.x configuration files' call do_collect_files('clu_cfg_3x','Sun Cluster 3.x Configuration Files','4',\ 'Configuration Files',\@fil) debug ' Inside CLU collection, collecting Sun Cluster 3.x log files' if $flg call log_info(concat('Starting collection of eventlog files up to ',$siz,\ ' bytes')) else call log_info('Skipping collection of eventlog files as size is greater \ than the maximum allowed collection size. When needed, raise the value \ of EXP_CLUS_EVTLOG_MAXSIZE to allow collection of eventlog files',\ 'Skipping collection of eventlog files') call do_collect_files('clu_log_3x','Sun Cluster 3.x Log Files','4',\ 'Log Files',\@log) # Adjust the table of content unpretoc } =head1 SUN CLUSTER DATABASES COLLECTIONS Gathers Sun Cluster High Availability Databases information =cut # Define the macro to collect Informix cluster database information macro collect_db_informix {import $TOC,$TOP,$WRN,%DBG,%FLG,%TTL var (@cmd,%tbl) = () =head2 clu_cmd_db_inf - Sun Cluster Informix Databases Information Gathers Sun Cluster High Availability Informix databases information using the following commands: =over 2 =item o C =back =cut call push(@cmd,\ ['cluster/informix/ls-l_usr_lib',\ ${CMD.LS:'ls'},concat('-l /usr/lib | ',${CMD.GREP:'grep'},' informix'),\ '---+ Informix Files under /usr/lib Directory']) debug ' Inside CLU collection, collecting Informix database information' pretoc '4:Informix' call do_collect_commands('clu_cmd_db_inf',\ 'Sun Cluster Informix Database Commands','5',\ 'Commands',\@cmd) =head2 clu_cfg_db_inf - Sun Cluster Informix Databases Configuration Files For each High Availability Informix Database (HAINFLIST) returned by the C command, it collects the following configuration files: =over 2 =item o F<${INFDIR}/etc/sqlhosts> =item o F<${INFDIR}/etc/${CONFIG}> =back C<${CONFIG}> represents the configuration file name returned by the C command C<${INFDIR}> represents the database directory returned by the C command =head2 clu_log_db_inf - Sun Cluster Informix Databases Log Files For each High Availability Informix Database (HAINFLIST) returned by the C command, it collects the following log file associated to the C keyword in the F<${INFDIR}/etc/${CONFIG}> configuration file. =cut if ?testFile('fT','/var/opt/informix/inftab') {loop $cfg (command(join(' ',catCommand($FLG{'scbasedir'},'bin','hainformix'),\ 'list','2>/dev/null'))) {$cfg = field(':',1,$cfg) var $dir = field(':',1,grepFile('/var/opt/informix/inftab',$cfg,'f')) next !?testDir('d',$dir) var $fil = field('\s+',1,grepFile(catFile($dir,'etc',$cfg),'^MSGPATH','f')) if $fil call push($tbl{'log',$cfg},\ [join('/','cluster','informix',$cfg,basename($fil)),$fil]) call push($tbl{'cfg',$cfg},\ [join('/','cluster','informix',$cfg,$cfg),catFile($dir,'etc',$cfg)],\ [join('/','cluster','informix',$cfg,'sqlhosts'),\ catFile($dir,'etc','sqlhosts')]) } # Generate reports loop $typ (keys(%tbl)) {debug ' Inside CLU collection, collecting Informix database ',$DBG{$typ} report concat('clu_',$typ,'_db_inf') title '---+!! Sun Cluster Informix Database ',$TTL{$typ} title $TOC title $WRN loop $cfg (keys($tbl{$typ})) {prefix {write '---+',$cfg write '|*File Path*| *Size*|*Last Modified Date*|' } call do_collect_fil(@{$tbl{$typ,$cfg}}) if hasOutput(true) write $TOP } if isCreated(true) toc '5:[[',getFile(),'][rda_report][',$TTL{$typ},']]' } } # Adjust the table of content unpretoc } =head2 clu_cfg_db_ora - Sun Cluster Oracle Databases Configuration Files For each High Availability Oracle Database (ORASID) found in oratab file or returned by the C command, it collects the following configuration files: =over 2 =item o F<${IFILE}> =item o F<${ORAHOME}/dbs/config${ORASID}.ora> =item o F<${ORAHOME}/dbs/init${ORASID}.ora> =item o F<${ORAHOME}/network/admin/listener.ora> =item o F<${ORAHOME}/network/admin/sqlnet.ora> =item o F<${ORAHOME}/network/admin/tnsnames.ora> =item o F<${ORAHOME}/orainst/RELVER> =back =for stopwords ifile C<${IFILE}> represents the configuration ifile name. C<${ORAHOME}> represents the Oracle Home. =head2 clu_log_db_ora - Sun Cluster Oracle Databases Log Files For each High Availability Oracle Database (ORASID) found in oratab file or returned by the C command, it collects the following log files: =over 2 =item o F<${BDUMP}/alert_${ORASID}.log> =item o F<${BDUMP}/*.trc> (recursive) =back C<${BDUMP}> represents the location set in C database parameter. =cut # Define the macro to collect Oracle cluster database information macro collect_db_oracle {import $TOC,$TOP,$WRN,%DBG,%FLG,%TTL var (@bad,@hod,%tbl) = () # Obtain databases information from oratab file if ?testFile('fT','/var/opt/oracle/oratab') {loop $lin (grepFile('/var/opt/oracle/oratab','^\s*#|^\s*$','v')) {var ($hom,$sid) = (field(':',1,$lin),field(':',0,$lin)) next !and($hom,$sid) next !?testDir('d',$hom) if compare('eq',$sid,'*') {loop $sid (grepDir(catDir($hom,'dbs'), '^init.+\.ora$')) {var ($sid) = match($sid,'^init(.+)\.ora$') call push(@bad,[$hom,$sid,catFile($hom,'dbs',concat('init',$sid,'.ora'))]) call push(@hod,[$hom,$sid]) } } else {call push(@bad,[$hom,$sid,catFile($hom,'dbs',concat('init',$sid,'.ora'))]) call push(@hod,[$hom,$sid]) } } } # Obtain databases information using haoracle command if and($FLG{'scrunning'},expr('==',$FLG{'scversion'},2),\ is_pkg_installed('SUNWscor')) {loop $lin (command(join(' ',catCommand($FLG{'scbasedir'},'bin','haoracle'),\ 'list','2>/dev/null'))) {var ($ini,$sid) = (field(':',8,$lin),field(':',1,$lin)) next !and($ini,$sid) var $hom = dirname(dirname($ini)) next !?testDir('d',$hom) call push(@bad,[$hom,$sid,$ini]) } } # Define the macro to get BACKGROUND_DUMP_DEST location from a given init file macro get_dump_dest {var ($fil,$hom) = @arg var $dmp = trim(replace(value(field('#',0,\ grepFile($fil,'^[^#]*background_dump_dest','fi'))),\ "'","",true),'"') var $dmp = replace($dmp,'\?',$hom) var $dmp = replace($dmp,'\$ORACLE_HOME',$hom) var $dmp = replace($dmp,'\$\{ORACLE_HOME\}',$hom) if ?testDir('d',$dmp) return $dmp loop $ifi (grepFile($fil,'^[^#]*ifile','i')) {$ifi = trim(replace(value(field('#',0,$ifi)),"'","",true),'"') var $ifi = replace($ifi,'\?',$hom) var $ifi = replace($ifi,'\$ORACLE_HOME',$hom) var $ifi = replace($ifi,'\$\{ORACLE_HOME\}',$hom) next !?testFile('fT',$ifi) return get_dump_dest($ifi,$hom) } return undef } # Collect data from ORACLE_BASE loop $bad (@bad) {($hom,$ini,$sid) = ($bad->[0],$bad->[2],$bad->[1]) if !?testFile('fT',$ini) {call log_info(concat('Config file ',$ini,' for SID ',$sid,' not found')) next } # Collect database alert log file var $dmp = get_dump_dest($ini,$hom) if and(not(defined($dmp)),testFile('fT',\ catFile($hom,'rdbms','log',concat('alert_',$sid,'.log')))) var $dmp = catDir($hom,'rdbms','log') next !?testDir('d',$dmp) var $alr = catFile($dmp,concat('alert_',$sid,'.log')) call push($tbl{'log',$sid},\ [join('/','cluster','oracle',$sid,concat('alert_',$sid,'.log')),$alr]) # Collect any tracefiles created in the last 14 days loop $fil (grepDir($dmp,'\.trc$','rm14')) call push($tbl{'log',$sid},\ [join('/','cluster','oracle',$sid,'tracefiles',basename($fil)),$fil]) # Collect ifile and config${SID}.ora files var $ifi = trim(replace(value(field('#',0,\ grepFile($ini,'^[^#]*ifile','fi'))),\ "'","",true),'"') var $ifi = replace($ifi,'\?',$hom) var $ifi = replace($ifi,'\$ORACLE_HOME',$hom) var $ifi = replace($ifi,'\$\{ORACLE_HOME\}',$hom) if ?testFile('fT',$ifi) call push($tbl{'cfg',$sid},\ [join('/','cluster','oracle',$sid,basename($ifi)),$ifi]) else call push($tbl{'cfg',$sid},\ [join('/','cluster','oracle',$sid,concat('config',$sid,'.ora')),\ catFile(dirname($ini),concat('config',$sid,'.ora'))]) } # Collect data from ORACLE_HOME loop $hod (@hod) {($hom,$sid) = ($hod->[0],$hod->[1]) # Collect version and init files call push($tbl{'cfg',$sid},\ [join('/','cluster/oracle',$sid,'RELVER'),\ catFile($hom,'orainst','RELVER')],\ [join('/','cluster/oracle',$sid,concat('init',$sid,'.ora')),\ catFile($hom,'dbs',concat('init',$sid,'.ora'))]) # Collect SqlNet configuration files call push($tbl{'cfg',$sid},\ [join('/','cluster/oracle',$sid,'listener.ora'),\ catFile($hom,'network/admin','listener.ora')],\ [join('/','cluster/oracle',$sid,'sqlnet.ora'),\ catFile($hom,'network/admin','sqlnet.ora')],\ [join('/','cluster/oracle',$sid,'tnsnames.ora'),\ catFile($hom,'network/admin','tnsnames.ora')]) } pretoc '4:Oracle' # Generate reports loop $typ (keys(%tbl)) {debug ' Inside CLU collection, collecting Oracle database ',$DBG{$typ} report concat('clu_',$typ,'_db_ora') title '---+!! Sun Cluster Oracle Database ',$TTL{$typ} title $TOC title $WRN loop $sid (keys($tbl{$typ})) {prefix {write '---+',$sid write '|*File Path*| *Size*|*Last Modified Date*|' } call do_collect_fil(@{$tbl{$typ,$sid}}) if hasOutput(true) write $TOP } if isCreated(true) toc '5:[[',getFile(),'][rda_report][',$TTL{$typ},']]' } # Adjust the table of content unpretoc } # Define the macro to collect Sybase cluster database information macro collect_db_sybase {import $TOC,$TOP,$WRN,%DBG,%FLG,%TTL var (@cmd,%tbl) = () =head2 clu_cmd_db_syb - Sun Cluster Sybase Databases Information Gathers Sun Cluster High Availability Sybase databases information using the following commands: =over 2 =item o C =back =cut call push(@cmd,\ ['cluster/sybase/ls-lR_var_opt_sybase',\ ${CMD.LS:'ls'},'-lR /var/opt/sybase',\ '---+ Sybase Files under /var/opt/sybase Directory']) debug ' Inside CLU collection, collecting Sybase database information' pretoc '4:Sybase' call do_collect_commands('clu_cmd_db_syb',\ 'Sun Cluster Sybase Database Commands','5',\ 'Commands',\@cmd) =head2 clu_cfg_db_syb - Sun Cluster Sybase Databases Configuration Files =for stopwords sybtab For each High Availability Sybase Database found in sybtab file it collects the following configuration files: =over 2 =item o F<${SYBHOME}/init/sqlsrv/version> =item o F<${SYBHOME}/interfaces> =back C<${SYBHOME}> represents the Sybase Home. =cut # Collect configuration files if ?testFile('fT','/var/opt/sybase/sybtab') {loop $lin (grepFile('/var/opt/sybase/sybtab','^\s*#|^\s*$','v')) {var ($ins,$hom) = (field(':',0,$lin),field(':',1,$lin)) call push($tbl{'cfg',$ins},\ [join('/','cluster','sybase',$ins,'version'),\ catFile($hom,'init','sqlsrv','version')],\ [join('/','cluster','sybase',$ins,'interfaces'),\ catFile($hom,'interfaces')]) } } else call log_info('Sybase installed but /var/opt/sybase/sybtab does not exist') =head2 clu_log_db_syb - Sun Cluster Sybase Databases Log Files For each High Availability Sybase Database returned by the C command, it collects the log file specified in the C<-e> option of the Sybase database run script. =cut # Collect log files if and($FLG{'scrunning'},expr('==',$FLG{'scversion'},2)) {loop $itm (command(join(' ',catCommand($FLG{'scbasedir'},'bin','hasybase'),\ 'list','2>/dev/null'))) {var ($ins,$run) = (field(':',1,$itm),field(':',8,$itm)) if ?testFile('fT',$run) {var ($log) = grepFile($run,'\-e') var $log = field('\s',0,substr($log,2)) next !$log call push($tbl{'log',$ins},\ [join('/','cluster','sybase',$ins,basename($log)),$log]) } else call log_info(concat('SQL server file ',$run,' not found')) } } # Generate reports loop $typ (keys(%tbl)) {debug ' Inside CLU collection, collecting Sybase database ',$DBG{$typ} report concat('clu_',$typ,'_db_syb') title '---+!! Sun Cluster Sybase Database ',$TTL{$typ} title $TOC title $WRN loop $ins (keys($tbl{$typ})) {prefix {write '---+',$ins write '|*File Path*| *Size*|*Last Modified Date*|' } call do_collect_fil(@{$tbl{$typ,$ins}}) if hasOutput(true) write $TOP } if isCreated(true) toc '5:[[',getFile(),'][rda_report][',$TTL{$typ},']]' } # Adjust the table of content unpretoc } =head1 SUN CLUSTER DATA SERVICES COLLECTIONS =head2 clu_cmd_ds_inf - Informix Cluster Data Service Information Gathers Informix Cluster Data Service information using the following commands: =over 2 =item o C<${CLUSTERBIN}/hainformix list> =back C<${CLUSTERBIN}> represents the Sun Cluster package binary directory location. =head2 clu_cfg_ds_inf - Informix Cluster Data Service Configuration Files Gathers the following Informix Cluster Data Service configuration files: =over 2 =item o F =item o F =back =cut # Define the macro to collect Informix cluster data service information macro collect_ds_informix {import %FLG,$TOC,$TOP,$WRN var (@cmd,@fil) = () loop $fil ('/var/opt/informix/etc/sqlhosts','/var/opt/informix/inftab') call push(@fil,[concat('cluster',$fil),$fil]) if $FLG{'scrunning'} call push(@cmd,\ ['cluster/informix/hainformix_list',\ catFile($FLG{'scbasedir'},'bin','hainformix'),'list',\ '---+ Status of all Configured Informix Databases']) debug ' Inside CLU collection, collecting Informix data service information' pretoc '4:Informix' call do_collect_commands('clu_cmd_ds_inf',\ 'Sun Cluster Informix Data Service Commands',\ '5','Commands',\@cmd) debug ' Inside CLU collection, collecting Informix data service',\ ' configuration files' call do_collect_files('clu_cfg_ds_inf',\ 'Sun Cluster Informix Data Service Configuration Files',\ '5','Configuration Files',\@fil) # Adjust table of contents unpretoc } =head2 clu_cfg_ds_nfs - Network File System Data Service Configuration Files Gathers the following Network File System (NFS) Cluster Data Service configuration files: =over 2 =item o F<${PATHPREFIX}/SUNW.nfs/dfstab.${RSNAME}> =back C<${PATHPREFIX}> represents the directory location indicated in the C group property value defined for C resources. C<${RSNAME}> represents the resource name. =cut # Define the macro to collect NFS cluster data service information macro collect_ds_nfs {import %RG var @fil = () loop $key (keys(%RG,'IA')) {next !compare('eq',$RG{$key}->{'type'},'SUNW.nfs') var $pth = trim(field('Res Group Pathprefix\:',1,\ grepCommand(join(' ','/usr/cluster/bin/scrgadm -pvv -g',\ quote($RG{$key}->{'group'}),'2>/dev/null'),\ concat('\(',$RG{$key}->{'group'},'\) Res Group Pathprefix:'),'f'))) call push(@fil,\ [concat('cluster/hanfs/dfstab.',$RG{$key}->{'resource'}),\ catFile($pth,'SUNW.nfs',concat('dfstab.',$RG{$key}->{'resource'}))]) } debug ' Inside CLU collection, collecting NFS data service configuration files' pretoc '4:Network File System (NFS)' call do_collect_files('clu_cfg_ds_nfs',\ 'Network File System (NFS) Cluster Data Service Configuration Files',\ '5','Configuration Files',\@fil) # Adjust the table of content unpretoc } =head2 clu_cfg_ds_nshttp - Netscape Cluster Data Service Configuration Files Gathers the following Netscape Cluster Data Service configuration files: =over 2 =item o F<${CONFDIR}/config/magnus.conf> =back C<${CONFDIR}> represents the directory location indicated in the C resource property value defined for C resources. =cut # Define the macro to collect Netscape cluster data service information macro collect_ds_nshttp {import %RG var @fil = () loop $key (keys(%RG,'IA')) {next !compare('eq',$RG{$key}->{'type'},'SUNW.iws') var $pth = trim(field('Res property value\:',1,\ grepCommand(join(' ','/usr/cluster/bin/scrgadm -pvv -j',\ quote($RG{$key}->{'resource'}),'2>/dev/null'),\ concat('\(',$RG{$key}->{'group'},':',$RG{$key}->{'resource'},\ ':Confdir_list\) Res property value:'),'f'))) call push(@fil,\ [concat('cluster/nshttp/magnus.conf.',$RG{$key}->{'resource'}),\ catFile($pth,'config','magnus.conf')]) } debug ' Inside CLU collection, collecting Netscape data service',\ ' configuration files' pretoc '4:Netscape' call do_collect_files('clu_cfg_ds_nshttp',\ 'Netscape Cluster Data Service Configuration Files',\ '5','Configuration Files',\@fil) # Adjust the table of content unpretoc } =head2 clu_cmd_ds_ora - Oracle Cluster Data Service Information Gathers Oracle Cluster Data Service information using the following commands: =over 2 =item o C<${CLUSTERBIN}/haoracle list> =back C<${CLUSTERBIN}> represents the Sun Cluster package binary directory location. =head2 clu_cfg_ds_ora - Oracle Cluster Data Service Configuration Files Gathers the following Oracle Cluster Data Service configuration files: =over 2 =item o F =item o F =item o F =item o F =back =cut # Define the macro to collect Oracle cluster data service information macro collect_ds_oracle {import %FLG var (@cmd,@fil) = () loop $fil ('/var/opt/oracle/listener.ora','/var/opt/oracle/oratab',\ '/var/opt/oracle/sqlnet.ora','/var/opt/oracle/tnsnames.ora') call push(@fil,[concat('cluster',$fil),$fil]) if and($FLG{'scrunning'},expr('==',$FLG{'scversion'},2)) call push(@cmd,\ ['cluster/oracle/haoracle_list',\ catFile($FLG{'scbasedir'},'bin','haoracle'),'list',\ '---+ Status of all Configured Oracle Databases']) debug ' Inside CLU collection, collecting Oracle data service information' pretoc '4:Oracle' call do_collect_commands('clu_cmd_ds_ora',\ 'Sun Cluster Oracle Data Service Commands',\ '5','Commands',\@cmd) debug ' Inside CLU collection, collecting Oracle data service',\ ' configuration files' call do_collect_files('clu_cfg_ds_ora',\ 'Sun Cluster Oracle Data Service Configuration Files',\ '5','Configuration Files',\@fil) # Adjust table of contents unpretoc } =head2 clu_cmd_ds_sap - SAP Cluster Data Service Information For each High Availability SAP Data Service (SAPSID) found in C file, it collects the following commands: =over 2 =item o C =item o C =back =head2 clu_cfg_ds_sap - SAP Cluster Data Service Configuration Files For each High Availability SAP Data Service (SAPSID) found in C file, it collects the configuration files: =over 2 =item o F (recursive) =back =head2 clu_log_ds_sap - SAP Cluster Data Service Log Files For each High Availability SAP Data Service (SAPSID) found in C file, it collects the log files: =over 2 =item o F =item o F =item o F =item o F =item o F =back =cut # Define the macro to collect SAP cluster data service information macro collect_ds_sap {import $TOC,$TOP,$WRN,%DBG,%TTL var (@cmd,%tbl) = () if ?testFile('f','/etc/opt/SUNWscsap/hadsconf') {loop $sid (grepFile('/etc/opt/SUNWscsap/hadsconf','YOUR_SAP_SID')) {next !?$sid = field('\s',4,$sid) call push(@cmd,\ {cmd => 'TITLE',\ txt => concat('---+ ',$sid,' SAP SID')},\ [join('/','cluster','sap',$sid,'disp+work-V'),\ catFile('/usr/sap',$sid,'SYS/exe/run/disp+work'),'-V',\ '---++ Information'],\ [join('/','cluster','sap',$sid,'ps-ecf'),\ ${CMD.PS:'ps'},concat('-ecf | ',${CMD.GREP:'grep'},' ',quote($sid)),\ '---++ Running Processes'],\ {cmd => 'UNTITLE'}) call push($tbl{'cfg',$sid},\ [join('/','cluster','sap',$sid,'profile'),\ catDir('/usr/sap',$sid,'SYS/profile'),true]) ($dir) = grepDir(catDir('/usr/sap',$sid),'DVEBMGS[0-9][0-9]','fp') call push($tbl{'log',$sid},\ [join('/','cluster','sap',$sid,'work'),catDir($dir,'work'),'','',\ '\.log$|\.trc$|^dev|^std|^[A-Z]','n']) } } debug ' Inside CLU collection, collecting SAP data service information' pretoc '4:SAP' call do_collect_commands('clu_cmd_ds_sap',\ 'SAP Cluster Data Service Commands',\ '5','Commands',\@cmd) # Generate reports loop $typ (keys(%tbl)) {debug ' Inside CLU collection, collecting SAP data service ',$DBG{$typ} report concat('clu_',$typ,'_ds_sap') title '---+!! SAP Cluster Data Service ',$TTL{$typ} title $TOC title $WRN loop $cfg (keys($tbl{$typ})) {prefix {write '---+',$cfg write '|*File Path*| *Size*|*Last Modified Date*|' } call do_collect_fil(@{$tbl{$typ,$cfg}}) if hasOutput(true) write $TOP } if isCreated(true) toc '5:[[',getFile(),'][rda_report][',$TTL{$typ},']]' } # Adjust table of contents unpretoc } =head2 clu_cmd_ds_syb - Sybase Cluster Data Service Information Gathers Sybase Cluster Data Service information using the following commands: =over 2 =item o C<${CLUSTERBIN}/hasybase list> =back C<${CLUSTERBIN}> represents the Sun Cluster package binary directory location. =head2 clu_cfg_ds_syb - Sybase Cluster Data Service Configuration Files Gathers the following Sybase Cluster Data Service configuration files: =over 2 =item o F =item o F =back =cut # Define the macro to collect Sybase cluster data service information macro collect_ds_sybase {import %FLG var (@cmd,@cfg) = () if and($FLG{'scrunning'},expr('==',$FLG{'scversion'},2)) call push(@cmd,\ ['cluster/sybase/hasybase_list',\ catFile($FLG{'scbasedir'},'bin','hasybase'),'list',\ '---+ Status of all Configured Sybase Databases']) loop $fil ('/var/opt/sybase/interfaces','/var/opt/sybase/sybtab') call push(@cfg,[concat('cluster',$fil),$fil]) debug ' Inside CLU collection, collecting Sybase data service information' pretoc '4:Sybase' call do_collect_commands('clu_cmd_ds_syb',\ 'Sybase Cluster Data Service Commands',\ '5','Commands',\@cmd) debug ' Inside CLU collection, collecting Sybase data service',\ ' configuration files' call do_collect_files('clu_cfg_ds_syb',\ 'Sybase Cluster Data Service Configuration Files',\ '5','Configuration Files',\@cfg) # Adjust table of contents unpretoc } =head2 clu_cfg_ds_zon - Zone Cluster Data Service Configuration Files Gathers the following Zone Cluster Data Service configuration files: =over 2 =item o F =item o F =item o F =back =cut # Define the macro to collect Zone cluster data service information macro collect_ds_zone {var @cfg = () call push(@cfg,\ ['cluster/zones/sczbt/sczbt_config',\ '/opt/SUNWsczone/sczbt/util/sczbt_config'],\ ['cluster/zones/sczsh/sczsh_config',\ '/opt/SUNWsczone/sczsh/util/sczsh_config'],\ ['cluster/zones/sczsmf/sczsmf_config',\ '/opt/SUNWsczone/sczsmf/util/sczsmf_config']) debug ' Inside CLU collection, collecting Zone data service',\ ' configuration files' pretoc '4:Zone' call do_collect_files('clu_cfg_ds_zon',\ 'Zone Cluster Data Service Configuration Files',\ '5','Configuration Files',\@cfg) unpretoc } =head1 SUN CLUSTER DIAGNOSTIC TOOLKIT (DTK) COLLECTIONS =head2 clu_cmd_dtk - Sun Cluster Diagnostic Toolkit (DTK) Information Gathers Sun Cluster Diagnostic Toolkit (DTK) information using the following commands: =over 2 =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =item o C =back =cut # Define the macro to collect Sun Cluster Diagnostic Toolkit (DTK) information macro collect_dtk {import %FLG var ($flg,@cmd) = (true) # Add run-time collections #if and($FLG{'scrunning'},is_pkg_installed('SUNWscdtk')) if $FLG{'scrunning'} {call push(@cmd,\ ['cluster/dtk/dcs_config-c_info',\ '/usr/cluster/dtk/bin/dcs_config','-c info',\ '---+ DCS Information'],\ ['cluster/dtk/dcs_config-c_status',\ '/usr/cluster/dtk/bin/dcs_config','-c status',\ '---+ DCS Status']) if !?testFile('f','/usr/cluster/lib/sc/replctl') call push(@cmd,\ ['cluster/dtk/replctl',\ '/usr/cluster/dtk/bin/replctl',undef,\ '---+ High Availability Services']) call push(@cmd,\ ['cluster/dtk/print_net_state-s',\ '/usr/cluster/dtk/bin/print_net_state','-s',\ '---+ Networking State']) if !?testFile('f','/usr/cluster/lib/sc/cmm_ctl') call push(@cmd,\ ['cluster/dtk/cmm_ctl-g',\ '/usr/cluster/dtk/bin/cmm_ctl','-g',\ '---+ Nodes Status']) call push(@cmd,\ ['cluster/dtk/orbadmin-P',\ '/usr/cluster/dtk/bin/orbadmin','-P all',\ '---+ ORB State -P'],\ ['cluster/dtk/orbadmin-R',\ '/usr/cluster/dtk/bin/orbadmin','-R all',\ '---+ ORB State -R']) } # Add non-run-time collections var ($pid) = (command('/usr/bin/pgrep -n -x rgmd 2>/dev/null')) if and($pid,testFile('x','/usr/cluster/lib/sc/rgmd')) call push(@cmd,\ ['cluster/dtk/rgmd-cmm_dbg_buf',\ '/usr/bin/adb','/usr/cluster/lib/sc/rgmd -',\ concat('---+ RGM Daemon cmm_dbg_buf Symbol Debug Information ',\ '(Process ',$pid,')'),\ {det => concat('echo "0t',$pid,':A\n*cmm_dbg_buf/s\n:R\n\$q" | \ /usr/bin/adb /usr/cluster/lib/sc/rgmd -'),\ req => {inp => concat('0t',$pid,":A\012*cmm_dbg_buf/s\012:R\012$q\012"),\ pre => concat('echo "0t',$pid,\ ':A\n*cmm_dbg_buf/s\n:R\n\$q" |')}}]) ($pid) = (command('/usr/bin/pgrep -n -x ucmmd 2>/dev/null')) if and($pid,testFile('x','/usr/cluster/lib/ucmm/ucmmd')) call push(@cmd,\ ['cluster/dtk/ucmmd-cmm_dbg_buf',\ '/usr/bin/adb','/usr/cluster/lib/ucmm/ucmmd -',\ concat('---+ UCMM Daemon cmm_dbg_buf Symbol Debug Information ',\ '(Process ',$pid,')'),\ {det => concat('echo "0t',$pid,':A\n*cmm_dbg_buf/s\n:R\n\$q" | \ /usr/bin/adb /usr/cluster/lib/ucmm/ucmmd -'),\ req => {inp => concat('0t',$pid,":A\012*cmm_dbg_buf/s\012:R\012$q\012"),\ pre => concat('echo "0t',$pid,\ ':A\n*cmm_dbg_buf/s\n:R\n\$q" |')}}],\ ['cluster/dtk/ucmmd-ucmm_dbg_buf',\ '/usr/bin/adb','/usr/cluster/lib/ucmm/ucmmd -',\ concat('---+ UCMM Daemon ucmm_dbg_buf Symbol Debug Information ',\ '(Process ',$pid,')'),\ {det => concat('echo "0t',$pid,':A\n*ucmm_dbg_buf/s\n:R\n\$q" | \ /usr/bin/adb /usr/cluster/lib/ucmm/ucmmd -'),\ req => {inp => concat('0t',$pid,":A\012*ucmm_dbg_buf/s\012:R\012$q\012"),\ pre => concat('echo "0t',$pid,\ ':A\n*ucmm_dbg_buf/s\n:R\n\$q" |')}}]) debug ' Inside CLU collection, collecting DTK information' call do_collect_commands('clu_cmd_dtk',\ 'Sun Cluster Diagnostic Toolkit (DTK) Commands','3',\ 'Diagnostic Toolkit (DTK)',\@cmd) } =head1 SUN CLUSTER GEOGRAPHIC EDITION COLLECTIONS =head2 clu_cmd_geo - Sun Cluster Geographic Edition Information Gathers Sun Cluster Geographic Edition information using the following commands: =over 2 =item o C =item o C =item o C =item o C =item o C (on versions earlier than 4.2) =item o C (on versions 4.2 or later) =item o C =item o C =back =cut # Define the macro to collect Cluster Geographic Edition information macro collect_geo {var @cmd = () if ?testFile('x','/usr/cluster/bin/geohb') call push(@cmd,\ ['cluster/geo/geohb_list',\ '/usr/cluster/bin/geohb','list',\ '---+ Configuration']) if ?testFile('x','/usr/cluster/bin/geops') call push(@cmd,\ ['cluster/geo/geops_list',\ '/usr/cluster/bin/geops','list',\ '---+ Partnership Configuration']) if ?testFile('x','/usr/cluster/bin/geopg') {var ($ver) = grepCommand('/usr/cluster/bin/scinstall -p 2>/dev/null',\ '^(\d\.\d+)','f1') call push(@cmd,\ ['cluster/geo/geopg_list',\ '/usr/cluster/bin/geopg',cond(compare('VALID',$ver,'4.2'),'show','list'),\ '---+ Protection Group']) } if ?testFile('x','/usr/cluster/bin/geomg') call push(@cmd,\ ['cluster/geo/geomg_list',\ '/usr/cluster/bin/geomg','show',\ '---+ Multigroup Information']) if ?testFile('x','/usr/cluster/bin/geosite') call push(@cmd,\ ['cluster/geo/geosite_show-v',\ '/usr/cluster/bin/geosite','show -v',\ '---+ Sites Information']) if ?testFile('x','/usr/cluster/bin/geoadm') call push(@cmd,\ ['cluster/geo/geoadm_status',\ '/usr/cluster/bin/geoadm','status',\ '---+ Run-Time Status of Entities on the Local Cluster'],\ ['cluster/geo/geoadm_show',\ '/usr/cluster/bin/geoadm','show',\ '---+ Software Status on the Cluster']) debug ' Inside CLU collection, collecting Geographic Edition information' call do_collect_commands('clu_cmd_geo',\ 'Sun Cluster Geographic Edition Commands','3',\ 'Geographic Edition',\@cmd) } =head1 SUN CLUSTER PACKAGES COLLECTIONS =head2 clu_cmd_db_pkg - Sun Cluster Database Packages Information Gathers Sun Cluster database packages information using the following commands: =over 2 =item o C =item o C<${CLUSTERBIN}/hareg -q ${DB}> =back =for stopwords informix sybase C<${CLUSTERBIN}> represents the Sun Cluster package binary directory location. C<${DB}> represents the database type (C, C, C, C). C<${PKG}> represents the package name. =head2 clu_fil_db_pkg - Sun Cluster Database Packages Configuration Files Gathers the following Sun Cluster database packages configuration files: =over 2 =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F =item o F (recursive) =item o F<${CLUSTER}/ha/sap/hasap_start_all_instances> =item o F<${CLUSTER}/ha/sap/hasap_stop_all_instances> =back C<${CLUSTER}> represents the Sun Cluster package directory location. C<${DB}> represents the database type (C, C, C, C). C<${PKG}> represents the package name. =head2 clu_log_db_pkg - Sun Cluster Database Packages Log Files Gathers the following Sun Cluster database packages log files: =over 2 =item o F (sybase) =back C<${PKG}> represents the package name. =head2 clu_cmd_ds_pkg - Sun Cluster Data Service Packages Information Gathers Sun Cluster Data Service packages information using the following commands: =over 2 =item o C =item o C<${CLUSTERBIN}/hareg -q ${DS}> =back =for stopwords nshttp nsldap nsmail nsnews tivoli C<${CLUSTERBIN}> represents the Sun Cluster package binary directory location. C<${DS}> represents the data service type (C, C, C, C, C, C, C). C<${PKG}> represents the package name. =head2 clu_fil_ds_pkg - Sun Cluster Data Service Packages Configuration Files Gathers the following Sun Cluster Data Service packages configuration files: =over 2 =item o F =item o F =back C<${PKG}> represents the package name. =head2 clu_cmd_sc_pkg - Sun Cluster Generic Packages Information Gathers Sun Cluster generic 2,x and 3.x packages information using the following commands: =over 2 =item o C =back C<${PKG}> represents the package name. =cut # Define the macro to collect Sun Cluster packages information macro collect_pkg {import $TOC,$TOP,$WRN,%FLG,%TTL var ($txt,%pkg,%tbl) = ('') loop $itm ('SUNWcvm','SUNWscinf','SUNWscor','SUNWscorx','SUNWscsap',\ 'SUNWscsyb','SUNWudlm') {if is_pkg_installed($itm) var $pkg{'DB',$itm} = true } loop $itm ('SUNWscdns','SUNWschtt','SUNWsclts','SUNWscnew','SUNWscnsl',\ 'SUNWscnsm','SUNWsctiv') {if is_pkg_installed($itm) var $pkg{'DS',$itm} = true } if expr('==',$FLG{'scversion'},2) {loop $itm ('SUNWccd','SUNWccon','SUNWccp','SUNWcmm','SUNWcsnmp','SUNWdid',\ 'SUNWff','SUNWmdm','SUNWmond','SUNWpnm','SUNWsc','SUNWsccf',\ 'SUNWscch','SUNWscds','SUNWsci','SUNWscid','SUNWscins','SUNWsclb',\ 'SUNWscman','SUNWscmgr','SUNWscpro','SUNWscsdb','SUNWsma') {if is_pkg_installed($itm) var $pkg{'SC',$itm} = true } } else {loop $itm ('SUNWscdev','SUNWscfab','SUNWscgctl','SUNWscgctlr','SUNWscghb',\ 'SUNWscghbr','SUNWscgman','SUNWscgrepavs','SUNWscgrepavsu',\ 'SUNWscgspm','SUNWscman','SUNWscr','SUNWscsal','SUNWscsam',\ 'SUNWscscn','SUNWscshl','SUNWscssv','SUNWscu','SUNWscvm') {if is_pkg_installed($itm) var $pkg{'SC',$itm} = true } } loop $key (keys(%pkg)) {if match($key,'DB') {# Collect database pkgs information loop $val (keys($pkg{$key})) {call push($tbl{$key,'cmd'},\ {cmd => 'COMMENT',\ nam => 'cluster/packages/PKGLIST',\ txt => concat('Processed: ',$val)}) # Obtain data service information var $dat = check($val,'^SUNWscinf$','informix',\ '^SUNWscor$|^SUNWudlm$','oracle',\ '^SUNWscsap$','sap',\ '^SUNWscsyb$','sybase') if and($dat,$FLG{'scrunning'},expr('==',$FLG{'scversion'},2)) call push($tbl{$key,'cmd'},\ [join('/','cluster',$dat,'hareg-q'),\ catFile($FLG{'scbasedir'},'bin','hareg'),concat('-q ',$dat),\ concat('---+ Data Service "',$dat,'" Registration Options')]) system(concat('/usr/sbin/pkgchk -n ',quote($val),'> /dev/null 2>&1')) if status() call push($tbl{$key,'cmd'},\ [concat('cluster/packages/pkgchk-n.',$val),\ '/usr/sbin/pkgchk',concat('-n ',quote($val)),\ concat('---+ Package ',encode($val),' Installation Accuracy'),true]) if match($val,'^SUNWscsap$') {call push($tbl{$key,'cfg'},\ ['cluster/etc/opt/SUNWscsap/hadsconf','/etc/opt/SUNWscsap/hadsconf'],\ ['cluster/opt/SUNWcluster/ha/sap/hasap_start_all_instances',\ catFile($FLG{'scbasedir'},'ha/sap','hasap_start_all_instances')],\ ['cluster/opt/SUNWcluster/ha/sap/hasap_stop_all_instances',\ catFile($FLG{'scbasedir'},'ha/sap','hasap_stop_all_instances')]) # Bypass the rest of the loop next } if ?testDir('d',catDir('/var/opt',$val)) call push($tbl{$key,'cfg'},\ [join('/','cluster/var/opt',$val),lastDir(),true]) if and($dat,expr('==',$FLG{'scversion'},2)) call push($tbl{$key,'cfg'},\ [join('/','cluster/etc/opt',$val,concat('ha',$dat,'_support')),\ catFile('/etc/opt',$val,concat('ha',$dat,'_support'))],\ [join('/','cluster/etc/opt',$val,concat('ha',$dat,'_config_V1')),\ catFile('/etc/opt',$val,concat('ha',$dat,'_config_V1'))]) elsif expr('==',$FLG{'scversion'},3) {if match($val,'^SUNWcvm$') call push($tbl{$key,'cfg'},\ [join('/','cluster','opt',$val,'etc','cvm.conf'),\ catFile('/opt',$val,'etc','cvm.conf')]) elsif and($dat,match($val,'^SUNWscor$')) call push($tbl{$key,'cfg'},\ [join('/','cluster','opt',$val,concat($dat,'_listener'),'etc'),\ catDir('/opt',$val,concat($dat,'_listener'),'etc')],\ [join('/','cluster','opt',$val,concat($dat,'_server'),'etc'),\ catDir('/opt',$val,concat($dat,'_server'),'etc')]) elsif match($val,'^SUNWscsyb$') {call push($tbl{$key,'cfg'},\ [join('/','cluster','opt',$val,'etc'),catDir('/opt',$val,'etc')]) call push($tbl{$key,'log'},\ [join('/','cluster','opt',$val,'log'),catDir('/opt',$val,'log')]) } elsif match($val,'^SUNWudlm$') call push($tbl{$key,'cfg'},\ [join('/','cluster','opt',$val,'etc','udlm.conf'),\ catFile('/opt',$val,'etc','udlm.conf')]) } } } elsif match($key,'DS') {# Collect data service pkgs information loop $val (keys($pkg{$key})) {call push($tbl{$key,'cmd'},\ {cmd => 'COMMENT',\ nam => 'cluster/packages/PKGLIST',\ txt => concat('Processed: ',$val)}) if expr('==',$FLG{'scversion'},2) call push($tbl{$key,'cfg'},\ [join('/','cluster','etc','opt',$val,'hadsconf'),\ catFile('/etc/opt',$val,'hadsconf')]) # Obtain data service information var $ds = check($val,'^SUNWscdns$','dns',\ '^SUNWschtt$','nshttp',\ '^SUNWsclts$','lotus',\ '^SUNWscnew$','nsnews',\ '^SUNWscnsl$','nsldap',\ '^SUNWscnsm$','nsmail',\ '^SUNWsctiv$','tivoli') next !?$ds if and($ds,$FLG{'scrunning'},expr('==',$FLG{'scversion'},2)) call push($tbl{$key,'cmd'},\ [join('/','cluster',$ds,'hareg-q'),\ catFile($FLG{'scbasedir'},'bin','hareg'),concat('-q ',$ds),\ concat('---+ Data Service "',$ds,'" Registration Options')]) elsif expr('==',$FLG{'scversion'},3) call push($tbl{$key,'cfg'},\ [join('/','cluster','opt',$val,'etc'),catDir('/opt',$val,'etc')]) system(concat('/usr/sbin/pkgchk -n ',quote($val),'> /dev/null 2>&1')) if status() call push($tbl{$key,'cmd'},\ [concat('cluster/packages/pkgchk-n.',$val),\ '/usr/sbin/pkgchk',concat('-n ',quote($val)),\ concat('---+ Package ',encode($val),' Installation Accuracy'),true]) } } else {# Collect generic SC packages information loop $val (keys($pkg{$key})) {call push($tbl{$key,'cmd'},\ {cmd => 'COMMENT',\ nam => 'cluster/packages/PKGLIST',\ txt => concat('Processed: ',$val)}) system(concat('/usr/sbin/pkgchk -n ',quote($val),'> /dev/null 2>&1')) if status() call push($tbl{$key,'cmd'},\ [concat('cluster/packages/pkgchk-n.',$val),\ '/usr/sbin/pkgchk',concat('-n ',quote($val)),\ concat('---+ Package ',encode($val),' Installation Accuracy'),true]) } } } # Generate the reports pretoc '3:Packages' loop $key (keys(%tbl)) {var $itm = check($key,'DB','Database',\ 'DS','Data Service',\ concat('Generic (',$FLG{'scversion'},'.x)')) pretoc '4:',$itm loop $typ (keys($tbl{$key})) {debug ' Inside CLU collection, collecting ',lc($itm),' packages ',$DBG{$typ} report concat('clu_',$typ,'_',lc($key),'_pkg') if match($typ,'cmd') {title '---+!! Sun Cluster ',$itm,' Packages Commands' title $TOC call do_exec(@{$tbl{$key,$typ}}) } else {prefix {write '---+!! Sun Cluster ',$itm,' Packages ',$TTL{$typ} write $WRN write '|*File Path*| *Size*|*Last Modified Date*|' } call do_collect_fil(@{$tbl{$key,$typ}}) if hasOutput(true) write $TOP } if isCreated(true) toc '5:[[',getFile(),'][rda_report][',$TTL{$typ},']]' } # Adjust the table of content unpretoc } # Adjust the table of content unpretoc } =head1 SUN CLUSTER SOLSTICE DISKSUITE (SDS) COLLECTIONS =head2 clu_cmd_sds - Sun Cluster Solstice DiskSuite (SDS) Information Gathers Sun Cluster Solstice DiskSuite (SDS) information using the following commands: =over 2 =item o C<${CLUSTERBIN}/scdidadm -c> =item o C<${CLUSTERBIN}/scdidadm -l> =item o C<${CLUSTERBIN}/scdidadm -L> =back C<${CLUSTERBIN}> represents the Sun Cluster package binary directory location. C<${SDSBIN}> represents the binary directory location for packages C and C. For each set (SET) returned by the C<${SDSBIN}/metaset | grep 'Set name'| sed 's/Set name = //'| cut -d, -f 1> command, it collects the following command: =over 2 =item o C<${SDSBIN}/medstat -s ${SET}> =back =head2 clu_cfg_sds - Sun Cluster Solstice DiskSuite (SDS) Configuration Files Gathers the following Sun Cluster Solstice DiskSuite (SDS) configuration file: =over 2 =item o F =back =cut # Define the macro to collect Sun Cluster Solstice DiskSuite information macro collect_sds {import %FLG ($sds,@cmd,@cfg) = () if expr('==',$FLG{'scversion'},2) call push(@cfg,['cluster/etc/did.conf','/etc/did.conf']) call push(@cmd,\ ['cluster/did/scdidadm-c',\ catFile($FLG{'scbasedir'},'bin','scdidadm'),'-c',\ '---+ Consistency Check'],\ ['cluster/did/scdidadm-l',\ catFile($FLG{'scbasedir'},'bin','scdidadm'),'-l',\ '---+ Local Devices in the DID Configuration File'],\ ['cluster/did/scdidadm-L',\ catFile($FLG{'scbasedir'},'bin','scdidadm'),'-L',\ '---+ Paths of the Devices in the DID Configuration File']) if is_pkg_installed('SUNWmdm') {if is_pkg_installed('SUNWmdr') var $sds = '/usr/sbin' elsif is_pkg_installed('SUNWmd') var $sds = '/usr/opt/SUNWmd/sbin' if ?$sds {call push(@cmd,\ {cmd => 'TITLE',\ txt => '---+ SDS Disk Sets'}) loop $set (grepCommand(join(' ',catCommand($sds,'metaset'),'2>/dev/null'),\ 'Set name\s+=\s+(.*?),','1')) call push(@cmd,\ [concat('cluster/sds/medstat-s.',$set),\ catFile($sds,'medstat'),concat('-s ',quote($set)),\ concat('---++ Status of Mediator Hosts (',$set,')')]) call push(@cmd,{cmd => 'UNTITLE'}) } } debug ' Inside CLU collection, collecting SDS information' pretoc '3:Solstice DiskSuite (SDS)' call do_collect_commands('clu_cmd_sds',\ 'Sun Cluster Solstice DiskSuite (SDS) Commands','4',\ 'Commands',\@cmd) debug ' Inside CLU collection, collecting SDS configuration files' call do_collect_files('clu_cfg_sds',\ 'Sun Cluster Solstice DiskSuite (SDS) Configuration \ Files','4','Configuration Files',\@cfg) # Adjust the table of content unpretoc } # Define the macro to obtain data services resources information macro get_ds_resources {import %RG keep %RG var ($flg,$idx,$val,%dev) = (false,0) loop $lin (command('/usr/cluster/bin/scrgadm -p 2>/dev/null')) {var $val = trim(field(':',1,$lin)) if match($lin,'^Res Group name:') var ($flg,$dev{'group'}) = (true,$val) elsif match($lin,'^Res Type name:') var $flg = false elsif and($flg,match($lin,'^ Res name:')) var $dev{'resource'} = $val elsif and($flg,match($lin,'^ Res resource type:')) var $dev{'type'} = $val if and(defined($dev{'group'}),\ defined($dev{'resource'}),\ defined($dev{'type'})) {var $RG{$idx} = {group =>$dev{'group'},\ resource=>$dev{'resource'},\ type =>$dev{'type'}} incr $idx var %dev = () } } } # Validate the execution context if !${OS.solaris} return if !${B_GLOBAL:true} return call log_run('Processing CLU sections ...') var (@MCM,@MFI,%RG) = () var %DBG = (cfg => 'configuration files',\ cmd => 'commands',\ log => 'log files') var %FLG = (ha_informix => is_pkg_installed('SUNWscinf'),\ ha_oracle => or(is_pkg_installed('SUNWscor'),\ is_pkg_installed('SUNWudlm')),\ ha_sybase => is_pkg_installed('SUNWscsyb'),\ osv => get_osv(),\ scbasedir => undef,\ scinstalled => or(testDir('d','/etc/opt/SUNWhadf'),\ testDir('d','/etc/opt/SUNWcluster'),\ testDir('d','/etc/cluster'),\ testFile('f','/etc/serialports')),\ scname => undef,\ scrunning => undef,\ scversion => or(testDir('d','/etc/opt/SUNWhadf'))) var %TTL = (cfg => 'Configuration Files',\ cmd => 'Commands',\ log => 'Log Files') pretoc '2:Cluster High Availability' # Collect Cacao 1.x (SUNWcacao) and Cacao 2.x (SUNWcacaort) information call collect_cacao() # Check if Cluster software is installed if !$FLG{'scinstalled'} call log_info('Cluster software not installed') else {# Add default collections if ?testFile('x','/usr/sbin/smcwebserver') call push(@MCM,\ ['cluster/smcwebserver/smcwebserver-V','/usr/sbin/smcwebserver','-V',\ '---+ Sun Web Console Version']) if and(not($FLG{'scversion'}),is_pkg_installed('SUNWccon')) call push(@MFI,['cluster/etc/clusters','/etc/clusters'],\ ['cluster/etc/serialports','/etc/serialports']) } # Collect Sun Cluster 1.x information if and($FLG{'scinstalled'},$FLG{'scversion'}) call collect_1x() # Set Cluster base directory and version if and($FLG{'scinstalled'},not($FLG{'scversion'})) ($FLG{'scbasedir'},$FLG{'scversion'}) = \ cond(is_pkg_installed('SUNWsc'),list('/opt/SUNWcluster',2),\ is_pkg_installed('SUNWscr'),list('/usr/cluster',3),\ list(undef,0)) # Obtain Cluster name if and($FLG{'scinstalled'},expr('==',$FLG{'scversion'},2)) var ($FLG{'scname'}) = \ grepFile('/etc/opt/SUNWcluster/conf/default_clustername','^\s*#|^\s*$','vf') # Determine which collections to run if or(not($FLG{'scinstalled'}),\ expr('<=',$FLG{'scversion'},1),\ and(expr('==',$FLG{'scversion'},2),not($FLG{'scname'}))) {if $FLG{'scinstalled'} {if expr('<>',$FLG{'scversion'},1) {# Collect Sun Cluster default information pretoc '3:Default Information' debug ' Inside CLU collection, collecting Sun Cluster information' call do_collect_commands('clu_cmd_dft','Sun Cluster Commands','4',\ 'Commands',\@MCM) debug ' Inside CLU collection, collecting Sun Cluster configuration files' call do_collect_files('clu_cfg_dft','Sun Cluster Configuration Files',\ '4','Configuration Files',\@MFI) unpretoc } if !$FLG{'scversion'} call log_info('Cannot locate SUNWsc package ... cluster collection skipped') if and(expr('==',$FLG{'scversion'},2),not($FLG{'scname'})) call log_info('Cannot locate default_clustername file, exiting script') } debug ' Inside CLU collection, skipping the rest of collections' } else {call log_info(concat('Starting collect_cluster_data at ',gmtime())) if expr('==',$FLG{'scversion'},2) {var $FLG{'scrunning'} = grepCommand(concat(${CMD.PS:'ps'},' -e 2>/dev/null'),\ 'clustd') # Collect Sun Cluster 2.x information call collect_2x() } else {call system('/usr/cluster/bin/scconf -pv >/dev/null 2>&1') var $FLG{'scrunning'} = cond(not(status()),true,false) # Collect Sun Cluster 3.x information call collect_3x() } # Collect cluster databases information pretoc '3:Databases' # Collect Informix cluster Database information if and($FLG{'ha_informix'},$FLG{'scrunning'},expr('==',$FLG{'scversion'},2)) call collect_db_informix() else debug ' Inside CLU collection, skipping Informix database collection' # Collect Oracle cluster database information if $FLG{'ha_oracle'} call collect_db_oracle() else debug ' Inside CLU collection, skipping Oracle database collection' # Collect Sybase cluster database information if $FLG{'ha_sybase'} call collect_db_sybase() else debug ' Inside CLU collection, skipping Sybase database collection' # Adjust the table of content unpretoc # Collect cluster data services information pretoc '3:Data Services' # Collect Informix cluster data service information if $FLG{'ha_informix'} call collect_ds_informix() else debug ' Inside CLU collection, skipping Informix data service collection' # Collect Netscape and NFS cluster data service information if and($FLG{'scrunning'},expr('==',$FLG{'scversion'},3)) {# Obtain data services resources information call get_ds_resources() # Collect Netscape cluster data service information if is_pkg_installed('SUNWschtt') call collect_ds_nshttp() else debug ' Inside CLU collection, skipping Netscape data service collection' # Collect NFS cluster data service information if is_pkg_installed('SUNWscnfs') call collect_ds_nfs() else debug ' Inside CLU collection, skipping NFS data service collection' } else debug ' Inside CLU collection, skipping Netscape and NFS data',\ ' services collection' # Collect Oracle cluster data service information if $FLG{'ha_oracle'} call collect_ds_oracle() else debug ' Inside CLU collection, skipping Oracle data service collection' # Collect SAP cluster data service information if and(expr('==',$FLG{'scversion'},2),is_pkg_installed('SUNWscsap')) call collect_ds_sap() else debug ' Inside CLU collection, skipping SAP data service collection' # Collect Sybase cluster data service information if $FLG{'ha_sybase'} call collect_ds_sybase() else debug ' Inside CLU collection, skipping Sybase data service collection' # Collect zone cluster data service information if and(expr('>=',$FLG{'osv'},'10'),is_pkg_installed('SUNWsczone')) call collect_ds_zone() else debug ' Inside CLU collection, skipping Zone data service collection' # Adjust the table of content unpretoc # Collect cluster Diagnostic Toolkit (DTK) information if expr('==',$FLG{'scversion'},3) call collect_dtk() else debug ' Inside CLU collection, skipping DTK collection' # Collect cluster Geographic Edition information if is_pkg_installed('SUNWscgctl') call collect_geo() else debug ' Inside CLU collection, skipping Geographic Edition collection' # Collect cluster packages information call collect_pkg() # Collect Cluster Solstice DiskSuite (SDS) information if or(and(expr('==',$FLG{'scversion'},2),is_pkg_installed('SUNWdid')),\ expr('==',$FLG{'scversion'},3)) call collect_sds() else debug ' Inside CLU collection, skipping SDS collection' call log_info(concat('Finished collect_cluster_data at ',gmtime())) } # Adjust the table of content unpretoc #------------------------------------------------------------------------------ # Input section #------------------------------------------------------------------------------ section input var $max = ${ENV.EXP_CLUS_EVTLOG_MAXSIZE:10485760} if !isNumber($max) var $max = 10485760 var ${RUN.EXPLORER.XPLR.CLU.N_EVTLOG_SIZE} = $max var ${RUN.EXPLORER.B_USE_CLU} = true =head1 SEE ALSO L, 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