# MCvxvm.ctl:254: Collects Veritas Volume Manager information. # $Id: MCvxvm.ctl,v 1.7 2014/01/02 13:17:46 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/EXPLORER/MCvxvm.ctl,v 1.7 2014/01/02 13:17:46 RDA Exp $ # # Change History # 20131220 JGS Fix spell. =head1 NAME EXPLORER:MCvxvm - Collects Veritas Volume Manager Information =head1 DESCRIPTION This module collects Veritas Volume Manager information. The following reports can be generated and are regrouped under C: =cut use Mrc # Initialization var $VALIDATE = true keep $VALIDATE section begin var $ERR = '---## Associated Errors' var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' run EXPLORER:XPLRlib('vxvm') # ----------------------------------------------------------------------------- # XPLR_vxvm section # ----------------------------------------------------------------------------- section XPLR_vxvm # Validate the execution context if !${B_GLOBAL:true} return call log_run('Processing VXVM sections ...') var $svm = is_pkg_installed('SUNWvxvm') var $vob = is_pkg_installed('VRTSob') var $vvm = is_pkg_installed('VRTSvxvm') if $vvm {var $ver = get_pkg_version('VRTSvxvm') if compare('LOWER',$ver,'3') var $svm = 1 } elsif !or($vob,$svm) return log_info('VxVM not installed') pretoc '2: Veritas Volume Manager' =head1 COMMANDS =cut =head2 vxvm_cmd_over - Overview Collects Veritas Volume Manager 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 =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 ${DSK} holds each disk returned by the command C. ${ENC} holds each enclosure returned by the command C. =cut debug ' Inside VXVM collection, gathering commands' pretoc '3:Commands' var @cmd = () # Add version independant commands call push(@cmd,\ {cmd => 'TITLE',\ txt => '---+ Configuration'},\ ['disks/vxvm/vxprint-Ath',\ '/usr/sbin/vxprint','-Ath',\ '---++ Active Disk Groups'],\ ['disks/vxvm/vxprint-h',\ '/usr/sbin/vxprint','-h',\ '---++ Associated Plexes'],\ ['disks/vxvm/vxprint-th',\ '/usr/sbin/vxprint','-th',\ '---++ Object Listings'],\ ['disks/vxvm/vxdg-q-list',\ '/usr/sbin/vxdg','-q list',\ '---++ Disk Groups'],\ ['disks/vxvm/ls-lR_dev_vx',\ '/usr/bin/ls','-lR /dev/vx',\ '---++ Contents of /dev/vx Directory'],\ ['disks/vxvm/ls-lLR_dev_vx',\ '/usr/bin/ls','-lLR /dev/vx',\ '---++ Contents of /dev/vx Directory (including Link References)'],\ ['etc/vx/sum',\ '/usr/bin/sum','/etc/vx/slib/* /usr/lib/libc.so.1 /usr/lib/libthread.so.1',\ '---++ File Check Sums'],\ {cmd => 'UNTITLE'}) # Add commands for 2.0 if $svm call push(@cmd,\ ['disks/vxvm/vxdisk-list',\ '/usr/sbin/vxdisk','list',\ '---++ Disk List']) # Add commands for 3.0 and later if compare('VALID',$ver,'3.0') {call push(@cmd,\ ['disks/vxvm/vxprint-thRL',\ '/usr/sbin/vxprint','-thrL',\ '---++ Volumes'],\ ['disks/vxvm/vxprint-hr',\ '/usr/sbin/vxprint','-hr',\ '---++ Subvolumes'],\ ['disks/vxvm/vxtask-list',\ '/usr/sbin/vxtask','list',\ '---++ Tasks'],\ ['disks/vxvm/vxdisk-list',\ '/usr/sbin/vxdisk','-o alldgs list',\ '---++ Associations']) # Add commands for each disk group if ?testFile('f','/usr/sbin/vxdisk') {call push(@cmd,{cmd => 'TITLE',txt => '---++ Disk Groups'}) loop $lin (grepCommand('/usr/sbin/vxdisk -o alldgs list',\ 'DEVICE|offline','v')) {if match($lin,'^(\S+)\s') call push(@cmd,\ [concat('disks/vxvm/disks/vxdisk_list=',last),\ '/usr/sbin/vxdisk',concat('list ',last),\ concat('---+++ ',last)]) } call push(@cmd,{cmd => 'UNTITLE'}) } # Add commands for 3.1.1 and later if compare('VALID',$ver,'3.1.1') {call push(@cmd,\ {cmd => 'TITLE',\ txt => '---+ Dynamic Multipathing'},\ ['disks/vxvm/vxdmpadm_listexclude',\ '/usr/sbin/vxdmpadm','listexclude',\ '---++ Excluded Disk Arrays'],\ ['disks/vxvm/vxdmpadm_listctlr_all',\ '/usr/sbin/vxdmpadm','listctlr all',\ '---++ Host Bus Adapter Controllers'],\ ['disks/vxvm/vxdmpadm_stat_restored',\ '/usr/sbin/vxdmpadm','stat restored',\ '---++ Automatic Path Restoration Daemon Status']) # Add commands for each enclosure if ?testFile('f','/usr/sbin/vxdmpadm') {loop $enc (grepCommand('/usr/sbin/vxdmpadm listctlr all','c')) {var $nam = field('\s+',3,$enc) call push(@cmd,\ [concat('disks/vxvm/vxdmpadm_getdmpnode_enclosure_',$nam),\ '/usr/sbin/vxdmpadm',concat('getdmpnode enclosure=',quote($nam)),\ concat('---++ Nodes Connected to Enclosure ',encode($nam))]) } } call push(@cmd,{cmd => 'UNTITLE'}) # Add commands for 3.2 and later if compare('VALID',$ver,'3.2') {call push(@cmd,\ {cmd => 'TITLE',\ txt => '---+ Device Discovery Layer Subsystem'},\ ['disks/vxvm/vxddladm_listjbod',\ '/usr/sbin/vxddladm','listjbod',\ '---++ JBOD Disks Types'],\ ['disks/vxvm/vxddladm_support_all',\ '/usr/sbin/vxddladm','listsupport all',\ '---++ Supported Disks Arrays'],\ ['disks/vxvm/vxddladm_exclude_all',\ '/usr/sbin/vxddladm','listexclude all',\ '---++ Excluded Disk Array Libraries'],\ ['disks/vxvm/vxdisk_path',\ '/usr/sbin/vxdisk','path',\ '---++ Subpaths'],\ {cmd => 'UNTITLE'}) # Add commands for 3.5 and later if compare('VALID',$ver,'3.5') {call push(@cmd,\ {cmd => 'TITLE',\ txt => '---+ Veritas License Information'},\ ['disks/vxvm/vxlicrep',\ '/sbin/vxlicrep',undef,\ '---++ Symantec Licenses Keys Report'],\ ['disks/vxvm/vxlicrep_e',\ '/sbin/vxlicrep','-e',\ '---++ Symantec Licenses Keys Expanded Report'],\ ['disks/vxvm/vxddladm_version_all',\ '/usr/sbin/vxddladm','listversion all',\ '---++ Array Support Libraries Version'],\ ['disks/vxvm/vxdisk-list',\ '/usr/sbin/vxdisk','-e -o alldgs list',\ '---++ Disk List with Extended Attributes'],\ {cmd => 'UNTITLE'}) # Add commands for 4.0 and later if compare('VALID',$ver,'4.0') call push(@cmd,\ {cmd => 'TITLE',\ txt => '---+ Logging Configuration'},\ ['disks/vxvm/vxcmdlog_l',\ '/usr/sbin/vxcmdlog','-l',\ '---++ Command Settings'],\ ['disks/vxvm/vxtranslog_l',\ '/usr/sbin/vxtranslog','-l',\ '---++ Transaction Settings'],\ {cmd => 'UNTITLE'}) } } } } debug ' Inside VXVM collection, gathering global commands' # Generate the report report vxvm_cmd_over title '---+!! Veritas Volume Manager Overview' title $TOC call do_exec(@cmd) if isCreated(true) toc '4:[[',getFile(),'][rda_report][Overview]]' =head2 Disk Groups Collects the following commands for each Veritas Volume Manager disk group: =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 Where: =over 2 =item o C<${DG}> holds the Disk Group Name and its value is obtained from the output of the command C. =item o C<${VOL}> holds the Volume List and its value is obtained from the output of the command C. =item o C<${PTH}> holds the path to the configuration disk. =back =cut # Determine the commands to collect var %cmd = () if ?testFile('f','/usr/sbin/vxdg') {loop $lin (grepCommand('/usr/sbin/vxdg -q list','disabled','v')) {# Determine the disk group var ($dg) = match($lin,'^(\S+)\s') if ?$dg {# Add version independant commands call push($cmd{$dg},\ [concat('disks/vxvm/disk_groups/vxdg-g_free=',$dg),\ '/usr/sbin/vxdg',concat('-g ',$dg,' free'),\ '---+ Free Space'],\ [concat('disks/vxvm/disk_groups/vxdg_list=',$dg),\ '/usr/sbin/vxdg',concat('list ',$dg),\ '---+ Status and Configuration Data'],\ [concat('disks/vxvm/disk_groups/vxprint-vng=',$dg),\ '/usr/sbin/vxprint',concat('-vng ',$dg),\ '---+ Volumes']) # Determine the disk volumes if ?testFile('f','/usr/sbin/vxprint') {var @lst = () loop $vol (command(join(' ','/usr/sbin/vxprint','-vng',$dg))) call push(@lst,quote($vol)) } # Add commands for 2.x machines if $svm {call push($cmd{$dg},\ [concat('disks/vxvm/disk_groups/vxprint-hmQqg=',$dg),\ '/usr/sbin/vxprint',join(' ','-hmQqg',$dg),\ '---+ Plexes and Subdisks']) if @lst call push($cmd{$dg},\ [concat('disks/vxvm/disk_groups/vxprint-hmQqg_4vxmk=',$dg),\ '/usr/sbin/vxprint',join(' ','-hmQqg',$dg,@lst),\ '---+ RLINKS, Volumes and Subdisks']) } else {call push($cmd{$dg},\ [concat('disks/vxvm/disk_groups/vxprint-mdg=',$dg),\ '/usr/sbin/vxprint',join(' ','-mdg',$dg),\ '---+ Disk Media'],\ [concat('disks/vxvm/disk_groups/vxprint-mvrGg=',$dg),\ '/usr/sbin/vxprint',join(' ','-mvrGg',$dg),\ '---+ Disk Group']) if @lst call push($cmd{$dg},\ [concat('disks/vxvm/disk_groups/vxprint-rmv_4vxmk=',$dg),\ '/usr/sbin/vxprint',join(' ','-rmvg',$dg,@lst),\ '---+ Subvolumes']) } if and(testFile('f','/usr/sbin/vxdg'),testFile('f','/usr/sbin/vxdisk')) {# Determine the configuration disk var $cmd = join(' ','/usr/sbin/vxdg','list',$dg) var $dev = field('\s',2,grepCommand($cmd,'state=clean','f')) # Determine the path to the configuration disk if ?$dev {var $cmd = join(' ','/usr/sbin/vxdisk','list',quote($dev)) var ($pth) = grepCommand($cmd,'privpaths:\s+block=(\S+)\s','1') if !?$pth var ($pth) = grepCommand($cmd,'pubpaths:\s+block=(\S+)\s','1') if ?$pth call push($cmd{$dg},\ [concat('disks/vxvm/disk_groups/vxprivutil-dumpconfig=',$dg),\ '/etc/vx/diag.d/vxprivutil',concat('dumpconfig ',$pth),\ '---+ Disk Dump']) } } # Add commands for 3.x machines if and(expr('>=',$rel,3),testFile('f','/usr/sbin/vxdisk')) {loop $lin (grepCommand('/usr/sbin/vxdisk -o alldgs list',\ 'DEVICE|offline','v')) {if match($lin,'^(\w+)\s') call push(@cmd,\ [concat('disks/vxvm/vxdisk_list=',last),\ '/usr/sbin/vxdisk',concat('list ',last),\ '---++ Disk Contents']) } } } } } debug ' Inside VXVM collection, gathering disk groups commands' pretoc '4:Disk Groups' # Generate the report loop $key (keys(%cmd)) {debug ' Inside VXVM collection, disk group: ',$key report concat('vxvm_cmd_dg_',$key) title '---+!! Disk Group: ',$key,' Information' title $TOC call do_exec(@{$cmd{$key}}) if isCreated(true) toc '5:[[',getFile(),'][rda_report][',$key,']]' } # Adjust the table of contents unpretoc 2 =for stopwords cfgrec dginfo diskinfo =head2 vxvm_cfg - Configuration Files Collects the most recent snapshot files (cfgrec.*, dginfo.*, diskinfo.*) from the directory C. Collects the following Veritas Volume Manager 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 =back Collects configuration files from the following directories: =over 2 =item F =item F (Recursive) =item F (Recursive) =item F (Recursive) =back =cut debug ' Inside VXVM collection, gathering configuration files' # Determine the files to collect var @fil = (\ ['etc/vx/vfstab.prevm', '/etc/vfstab.prevm'],\ ['etc/vx/S95vxvm-recover','/etc/rc2.d/S95vxvm-recover'],\ ['etc/vx/disk.info', '/etc/vx/disk.info'],\ ['etc/vx/volboot', '/etc/vx/volboot']) # Add snapshot files when directory exists if ?testDir('d','/etc/vx/cbr/bk') {call push(@fil,\ ['etc/vx/vxdmp.exclude','/etc/vx/vxdmp.exclude'],\ ['etc/vx/vxrelocd', '/etc/vx/vxrelocd'],\ ['etc/vx/vxvm.exclude', '/etc/vx/vxvm.exclude']) # Determine the files to collect with a size limit var ($max,$top) = (1572864,'/etc/vx/cbr/bk') var @sub = findDir($top,'^\.+$','nv') loop $sub (@sub) {loop $fil (grepDir(catDir($top,$sub),'(cfgrec|dginfo|diskinfo)$','np')) {call push(@fil,[join('/','etc/vx/cbr/bk',$sub,basename($fil)),$fil]) decr $max,getSize(lastFile()) } } var $flg = expr('<=',$max,0) loop $suf ('1','2','3','4','5') {break $flg loop $sub (@sub) {var @tmp = grepDir(catDir($pth,$sub),\ concat('(cfgrec|dginfo|diskinfo)\.',$suf,'$'),'np') loop $fil (@tmp) decr $max,getSize($fil) break $flg = expr('<=',$max,0) loop $fil (@tmp) call push(@fil,[join('/','etc/vx/cbr/bk',$sub,basename($fil)),$fil]) } } if $flg {# Report an incomplete collection output F,vxvm_incomplete_data call addBlock('E','D','etc/vx/cbr/incomplete_data') call writeComment(\ 'Due to space constraints, Explorer was unable to collect all of the \ /etc/vx/cbr directory. Only the most current snapshots have been \ collected here.') output F,vxvm_list_snapshot call addBlock('E','D','etc/vx/cbr/ls-lR_etc_vx_cbr_bk') call writeCommand('/usr/sbin/ls -lR /etc/vx/cbr/bk') } } # Generate the report report vxvm_cfg title '---+!! Veritas Volume Manager Configuration Files' title $TOC title ' * 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.' prefix {write '---+ Global Configuration Files' write '|*File Path*| *Size*|*Last Modified Date*|' } call do_collect_fil(@fil) if hasOutput(true) write $TOP # Collect additional directories if $vob {loop $dir (findDir('/var/vx/isis','(^\.+$|download|swap)','npv')) {prefix {write '---+ Contents of ',encode($dir) write '|*File Path*| *Size*|*Last Modified Date*|' } loop $fil (grepDir($dir,'^\.+$|\.jar|core','nprv')) call do_collect_fil(\ [concat('disks/vxvm/isis/',basename($fil)),$fil]) if hasOutput(true) write $TOP } } loop $rec (['etc/vx/elm', '/etc/vx/elm'],\ ['etc/vx/reconfig.d','/etc/vx/reconfig.d'],\ ['etc/vx/var', '/var/vxm']) {next !?testDir('d',$dir = $rec->[1]) prefix {write '---+ Contents of ',encode($dir) write '|*File Path*| *Size*|*Last Modified Date*|' } call do_collect_dir($rec->[0],$dir,true) if hasOutput(true) write $TOP } # Add the report to table of contents if isCreated(true) toc '3:[[',getFile(),'][rda_report][Configuration Files]]' =head2 vxvm_log - Log Files Collects Veritas Volume Manager log files from the following directories: =over 2 =item o F =item o F =back Collects the F file. =cut if compare('VALID',$ver,'3.0') {debug ' Inside VXVM collection, gathering log files' report vxvm_log prefix {write '---+!! Veritas Volume Manager Log Files' write $TOC write ' * 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.' write '|*File Path*| *Size*|*Last Modified Date*|' } if ?testDir('d','/var/opt/vmsa/logs') call do_collect_dir('disks/vxvm/logs',$dir) if expr('VALID',$ver,'4.0') call do_collect_fil(\ ['etc/vx/dmpevents.log','/etc/vx/dmpevents.log'],\ ['disks/vxvm/logs', '/var/adm/vx','','','^\.+$','nv']) if isCreated(true) {write $TOP toc '3:[[',getFile(),'][rda_report][Log Files]]' } } # Adjust the table of contents unpretoc =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