# MCdisk.ctl:250: Collects Disks and Controllers Information # $Id: MCdisk.ctl,v 1.18 2015/11/06 13:24:20 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/EXPLORER/MCdisk.ctl,v 1.18 2015/11/06 13:24:20 RDA Exp $ # # Change History # 20151103 JGS Extend Solaris diskinfo command collection. =head1 NAME EXPLORER:MCdisk - Collects Disks and Controllers Information =head1 DESCRIPTION This module collects information about disks and controllers installed on the system. =cut use Mrc use Buffer # 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('disks') #------------------------------------------------------------------------------ # XPLR_disks section #------------------------------------------------------------------------------ section XPLR_disks # Validate the execution context call log_run('Processing DISK sections ...') =head2 disks - Disks and Controllers Information Gathers disks and controllers information using the following commands: =over 2 =item o C<${DISKINFO} -d> =item o C<${HDBASE}/SUNWhd/hd/bin/hd -R> =item o C<${HDBASE}/SUNWhd/hd/bin/hd -T> =item o C<${HDBASE}/SUNWhd/hd/bin/hd -a> =item o C<${HDBASE}/SUNWhd/hd/bin/hd -g> =item o C<${HDBASE}/SUNWhd/hd/bin/hd -i> =item o C<${HDBASE}/SUNWhd/hd/bin/hd -j> =item o C<${HDBASE}/SUNWhd/hd/bin/hd -l> =item o C<${HDBASE}/SUNWhd/hd/bin/hd -o> =item o C<${HDBASE}/SUNWhd/hd/bin/hd -r> =item o C<${HDBASE}/SUNWhd/hd/bin/hd -x> =item o C<${HDBASE}/SUNWhd/hd/bin/hd> =item o C<${HDBASE}/SUNWhd/hd/bin/hdadm diskqual all> =item o C<${HDBASE}/SUNWhd/hd/bin/hdadm read_cache display all> =item o C<${HDBASE}/SUNWhd/hd/bin/hdadm smart all> =item o C<${HDBASE}/SUNWhd/hd/bin/hdadm write_cache display all> =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 (Solaris 11 and later) =item o C (sun4v Solaris 10 - update 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 (Collected twice) =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 also the following files: =over 2 =item o F<${HDBASE}/SUNWhd/web/hd_map.html> =item o F =item o F =item o F =back =cut debug ' Inside DISK collection, gathering disks information' pretoc '2:Disks' # Define global variables imported by some macros var ($RE,$SOCAL,$a35,@ret) = ('',false,false) # Define the capture macro macro capture_results {var ($rpt,$wrk) = @arg import @ret while ?$wrk->get_line() {var $lin = chomp(last) write {$rpt} $lin call push(@ret,$lin) } } # Define the clip macro macro clip_results {var ($rpt,$wrk) = @arg import @ret,$RE while ?$wrk->get_line() {var $lin = chomp(last) break match($lin,$RE) write {$rpt} $lin call push(@ret,$lin) } } # Define a macro to collect luxadm results, optionally with dump_map macro collect_luxadm {var ($ttl,$ver,$dmp) = @arg import $SOCAL call do_exec({cmd => 'TITLE',txt => $ttl}) loop $dev (grepCommand('/usr/sbin/luxadm -e port 2>/dev/null',\ '^(\S*).*\s{2}CONNECTED','1')) {if $flg = and(not(match($dev,'devctl')),match($dev,'socal')) var $SOCAL = true var $prt = cond($flg,replace(replace($dev,':0','\/sf@0,0:devctl'),\ ':1','\/sf@1,0:devctl'),\ $dev) var $fil = replace($prt,'\/','-',true) if $dmp call do_exec(\ [concat('disks/luxadm_-e_dump_map_',$fil),\ '/usr/sbin/luxadm',concat('-e dump_map ',$prt),\ '---++ WWN Data on Specified Fibre Channel Port']) else var $fil = concat($fil,'-',localtime('%H:%M:%S')) # Avoid command if SOCAL has multi-initiator on Oracle Solaris 6 if and($flg,\ compare('SAME',$ver,'5.6'),\ grepCommand(\ concat('/usr/sbin/luxadm -e dump_map ',$prt,' 2>/dev/null'),\ '0000000000000000 0000000000000000 0x1f','f')) call do_exec(\ [concat('disks/luxadm_-e_rdls',$fil,'.err'),\ undef,\ 'Explorer did not run this command on the SOCAL HBA because this is a \ SOCAL multi initiator configuration and causes momentary Loop \ offline/online if executed.',\ '---++ Link Error Status for Available Devices on the Loop']) else call do_exec(\ [concat('disks/luxadm_-e_rdls',$fil),\ '/usr/sbin/luxadm',concat('-e rdls ',$prt),\ '---++ Link Error Status for Available Devices on the Loop']) } call do_exec({cmd => 'UNTITLE'}) } # Perform the collections loop $rec (get_zones(false)) {if $loc = defined($nam = $rec->[0]) {var ($ttl,$pre,$exe) = (concat('From Zone ',$nam),\ concat('zones/',$nam),\ concat('/usr/sbin/zlogin ',$nam)) call log_info(concat('disks: RUNNING: zone ',$nam),\ concat(' Inside DISK collection, collecting from zone ',$nam)) } else var ($ttl,$pre,$exe) = ('From Global Zone') var $top = $rec->[1] report concat('disks_z_',nvl($nam,'global')) title '---+!! ',$ttl title $TOC if !$loc {# Push files and directories to collect var @fil = (\ ['G','disks/st.conf','/kernel/drv/st.conf'],\ ['G','disks/hwraid', '/var/opt/SUNWhwrdg',undef,undef,'^dptelog\..*','n'],\ ['G','etc/iscsi', '/etc/iscsi',undef,undef,'^\.+$','nv']) # Perform the first luxadm collection with dump_map option as true call collect_luxadm('---+ Fibre Channel Information (First Run)',$rec->[2],\ true) # Collect available disks var $RE = '^Specify disk' var @ret = () var $env = setEnv('NOINUSE_CHECK',1) call do_exec(\ {cmd => 'TITLE',txt => '---+ Available Disks'},\ ['disks/format','/usr/sbin/format','2>&1','---++ format Command',\ {req=>{inp=>'0',inc=>3},out=>{fct=>'clip_results'}}]) call setEnv('NOINUSE_CHECK',$env) var $a35 = grep(@ret,'A3500FC') if get_bin_tool('diskinfo') call do_exec(\ ['disks/diskinfo',last,'-d','---++ Diskinfo Tool',true]) call do_exec({cmd => 'UNTITLE'}) # Collect additional disk information if compare('VALID',$rec->[2],'5.11') call do_exec(\ ['disks/diskinfo_-A_SYS',\ '/usr/sbin/diskinfo','-A SYS -o Rcmesfp',\ '---++ Additional Disk Information']) elsif and(compare('SAME',$rec->[2],'5.10'),\ compare('eq',uname('m'),'sun4v')) {var ($ver) = grepFile('/etc/release','s10s_u(\d+)','f1') if expr('>=',$ver,10) call do_exec(\ ['disks/diskinfo_-a',\ '/usr/sbin/diskinfo','-a',\ '---++ Additional Disk Information']) } # Get directory contents if ?$cmd = ${CMD.LS} {var @dir = () loop $val (command(concat(${CMD.FIND:'find'},\ ' /dev -type d -print 2>/dev/null'))) call push(@dir,quote($val)) call do_exec(\ {cmd => 'TITLE',txt => '---+ Information from Filesystem'},\ ['disks/ls-l_dev_cfg', $cmd,'-l /dev/cfg/', '---++ /dev/cfg/'],\ ['disks/ls-l_dev_fc', $cmd,'-l /dev/fc', '---++ /dev/fc', {nul=>{}}],\ ['disks/ls-l_dev_nrst',$cmd,'-l /dev/nrst*','---++ /dev/nrst*',{nul=>{}}],\ ['disks/ls-l_dev_rdsk',$cmd,'-l /dev/rdsk', '---++ /dev/rdsk'],\ ['disks/ls-l_dev_rmt', $cmd,'-l /dev/rmt*', '---++ /dev/rmt*'],\ ['disks/ls-l_dev_rst', $cmd,'-l /dev/rst*', '---++ /dev/rst*', {nul=>{}}],\ ['disks/ls_-lAR_@dev_@devices',$cmd,'-lAR /dev /devices',\ '---++ /dev and /devices'],\ ['disks/maj_min_dev_num',$cmd,'-lL /dev/*dsk/', '---++ /dev/*dsk/'],\ ['disks/ls-lL_dev_rmt', $cmd,'-lL /dev/rmt/', '---++ /dev/rmt/'],\ ['disks/ls-ld_tmp', $cmd,'-ld /tmp', '---++ /tmp'],\ ['disks/dev-lL', $cmd,join(' ','-lL',@dir),'---++ /dev Contents'],\ {cmd => 'UNTITLE'}) } # Collect run-time information call do_exec(\ {cmd => 'TITLE',txt => '---+ I/O Statistics'},\ ['disks/iostat_-E', '/usr/bin/iostat','-E','---++ Errors']) if compare('VALID',$rec->[2],'5.9') call do_exec(\ ['disks/iostat-iE', '/usr/bin/iostat','-iE','---++ Errors (with ID)']) call do_exec(\ ['disks/iostat_-xpnc_3_3','/usr/bin/iostat','-xpnc 3 3','---++ Extended'],\ {cmd => 'UNTITLE'},\ {cmd => 'TITLE',txt => '---+ Swap'},\ ['disks/swap-l','/usr/sbin/swap','-l','---++ Status'],\ ['disks/swap-s','/usr/sbin/swap','-s','---++ Summary'],\ {cmd => 'UNTITLE'}) call do_exec(\ {cmd => 'TITLE',txt => '---+ Disk Free'},\ ['disks/df-al',${CMD.DF:'df'},'-al','---++ All'],\ ['disks/df-el',${CMD.DF:'df'},'-el','---++ Files'],\ ['disks/df-gl',${CMD.DF:'df'},'-gl','---++ Full'],\ ['disks/df-kl',${CMD.DF:'df'},'-kl','---++ Summary'],\ {cmd => 'UNTITLE'}) # Collect disk partitions information if ?$cmd = ${CMD.LS} {call do_exec({cmd => 'TITLE',txt => '---+ Disk Partitions'}) loop $dsk (grepCommand(concat($cmd,' /dev/rdsk/*s2 2>/dev/null'),\ '^/dev/rdsk/(.*)s2$','1')) {for $i (0,7) {var $dev = concat($dsk,'s',$i) call command(concat('/usr/sbin/devinfo -p /dev/rdsk/',$dev,' 2>/dev/null')) next status() call do_exec(\ [concat('disks/prtvtoc/',$dev),\ '/usr/sbin/prtvtoc',concat('/dev/rdsk/',$dev),\ concat('---++ On Device: ',$dev),true]) break } } call do_exec({cmd => 'UNTITLE'}) } # Collect UFS file systems information if ?$cmd = ${CMD.DF} {call do_exec({cmd => 'TITLE',txt => '---+ UFS Filesystems'}) loop $ret (command(concat($cmd,' -lFufs 2>/dev/null'))) {var ($fs,$dev) = match($ret,'^(.*?)\s*\((.*?)\)') var $RE = '^cylinder number ' var @ret = () call do_exec(\ [concat('disks/ufs/fstyp_-v_header=',replace($fs,'/','_',true)),\ '/usr/sbin/fstyp',concat('-v ',$dev),\ concat('---++ Filesystem: ',$fs),\ {out=>{fct=>'clip_results'},req=>{inc=>3}}]) } call do_exec({cmd => 'UNTITLE'}) } # Collect mounted file systems information call do_exec(\ {cmd => 'TITLE',txt => '---+ Mounted File Systems'},\ ['disks/mount',${CMD.MOUNT:'mount'},undef,'---++ Status'],\ ['disks/mount-v',${CMD.MOUNT:'mount'},'-v','---++ Verbose Status'],\ {cmd => 'UNTITLE'}) # Collect E450 Raid controller information if ?testFile('x',$cmd = '/opt/SUNWhwrdg/dptutil') call do_exec({cmd => 'TITLE',txt => '---+ E450 Raid Controller'},\ ['disks/hwraid/dptutil-L_all', $cmd,'-L all',\ '---++ All'],\ ['disks/hwraid/dptutil-L_controller',$cmd,'-L controller',\ '---++ Controller'],\ ['disks/hwraid/dptutil-L_logical', $cmd,'-L logical',\ '---++ Logical'],\ ['disks/hwraid/dptutil-L_physical', $cmd,'-L physical',\ '---++ Physical'],\ ['disks/hwraid/dptutil-L_raid', $cmd,'-L raid',\ '---++ Raid'],\ ['disks/hwraid/dptutil-L_spare', $cmd,'-L spare',\ '---++ Spare'],\ {cmd => 'UNTITLE'}) # Collect disk arrays information if ?testDir('d','/dev/es') {call do_exec({cmd => 'TITLE',txt => '---+ Disk Arrays'}) loop $fil (grepDir('/dev/es','^\.+$','nv')) {call do_exec(\ [concat('disks/luxadm_inq_dev_es_',$fil),\ '/usr/sbin/luxadm',concat('inq ',catCommand('/dev/es',$fil)),\ concat('---++ Inquire: ',encode($fil))]) sleep 1 } call do_exec({cmd => 'UNTITLE'}) } # Collect Sun Storage Subsystem Manager information if ?testFile('x','/opt/SUNWssmu/bin/ssmadmin') call do_exec({cmd => 'TITLE',txt => '---+ Sun Storage Subsystem Manager'},\ ['disks/ssmadmin--view',last,' -view','---++ Status Messages'],\ {cmd => 'UNTITLE'}) # Collect FCAL information call do_exec(\ {cmd => 'TITLE',txt => '---+ FCAL'},\ ['disks/luxadm_probe','/usr/sbin/luxadm','probe',\ '---++ Attached Subsystems'],\ {cmd => 'SLEEP',cnt => 1},\ ['disks/luxadm_probe_-p','/usr/sbin/luxadm','probe -p',\ '---++ Attached Subsystems (with Physical Pathname)'],\ {cmd => 'SLEEP',cnt => 1},\ ['disks/luxadm_-e_port','/usr/sbin/luxadm','-e port',\ '---++ Installed HBA'],\ {cmd => 'SLEEP',cnt => 1}) # Collect unless this system has Sonoma A3500FC if !$a35 call do_exec(\ ['disks/luxadm_fcode_download_-p','/usr/sbin/luxadm','fcode_download -p',\ '---++ Card Fcode Version'],\ ['disks/luxadm_qlgc_s_download', '/usr/sbin/luxadm','qlgc_s_download',\ '---++ Adapter Fcode Version']) call do_exec({cmd => 'UNTITLE'}) # Collect RAID info if FCAL disks have socal interface or controller present if or($SOCAL,\ grepCommand('/usr/sbin/raidctl 2>/dev/null','controller','fi')) {var @ret = () call do_exec(\ {cmd => 'TITLE',txt => '---+ RAID Information'},\ ['disks/raidctl',\ '/usr/sbin/raidctl',undef,\ '---++ Available Controllers, Volumes and Disks'],\ ['disks/raidctl_-S',\ '/usr/sbin/raidctl','-S',\ '---++ Configuration Information'],\ ['disks/raidctl_-l',\ '/usr/sbin/raidctl','-l',\ '---++ Available Controllers, Volumes and Disks',\ {out=>{fct=>'capture_results'}}]) loop $ret (@ret) {next !match($ret,'controller|volume|disk','i') if match($ret,'controller','i') {var (undef,$ctl) = split(':',$ret,2) var $ctl = trim($ctl) call do_exec(\ [concat('disks/raidctl_-l_',$ctl),\ '/usr/sbin/raidctl',concat('-l ',quote($ctl)),\ concat('---++ Controller ',$ctl,' Information')]) next } if match($ret,'volume','i') {var (undef,$vol) = split(':',$ret,2) var $vol = trim($vol) call do_exec(\ [concat('disks/raidctl_-l_',$vol),\ '/usr/sbin/raidctl',concat('-l ',quote($vol)),\ concat('---+++ Volume ',$vol,' Information')]) next } # Collect just one Explorer file with all controller/disk pairs var (undef,$dsk) = split(':',$ret,2) var $dsk = trim($dsk) call do_exec(\ ['disks/raidctl_-l_-g',\ '/usr/sbin/raidctl',concat('-l -g ',quote($dsk),' ',quote($ctl)),\ concat('---++++ Disk ',$dsk,' / Controller ',$ctl,' Information'),\ {out=>{mod=>true,cat=>'T'}}]) } call do_exec({cmd => 'UNTITLE'}) } # Collect RAID information with sas2ircu and raidconfig commands if ?testFile('x',$cmd = '/usr/sbin/sas2ircu') call do_exec(\ {cmd => 'TITLE',txt => '---+ sas2ircu RAID Information'},\ ['disks/sas2ircu_0_display_all',$cmd,'0 display all',\ '---++ Controller #0 Information'],\ ['disks/sas2ircu_0_status', $cmd,'0 status',\ '---++ Controller #0 Status'],\ ['disks/sas2ircu_1_display_all',$cmd,'1 display all',\ '---++ Controller #1 Information'],\ ['disks/sas2ircu_1_status', $cmd,'1 status',\ '---++ Controller #1 Status'],\ {cmd => 'UNTITLE'}) if ?testFile('x',$cmd = '/usr/sbin/raidconfig') call do_exec(\ {cmd => 'TITLE',txt => '---+ raidconfig RAID Information'},\ ['disks/raidconfig_list_all_-v',$cmd,'list all -v',\ '---++ Detailed RAID Information'],\ {cmd => 'UNTITLE'}) # Collect MultiPath information var @ret = () call do_exec(\ {cmd => 'TITLE',txt => '---+ MultiPath Information'},\ ['disks/mpathadm/mpathadm_list_initiator-port',\ '/usr/sbin/mpathadm','list initiator-port',\ '---++ Initiators',{out=>{fct=>'capture_results'}}]) loop $ret (@ret) {next !match($ret,'Initiator Port:') var $ini = trim(replace($ret,'Initiator Port:','',true)) call do_exec(\ [concat('disks/mpathadm/mpathadm_show_initiator-port_',$ini),\ '/usr/sbin/mpathadm',concat('show initiator-port ',quote($ini)),\ concat('---+++ Initiator: ',$ini)]) } var @ret = () call do_exec(\ ['disks/mpathadm/mpathadm_list_LU','/usr/sbin/mpathadm','list LU',\ '---++ Logical Units',{out=>{fct=>'capture_results'}}]) loop $ret (grep(@ret,'rdsk')) {var $lun = trim(replace($ret,'Logical Unit:','',true)) call do_exec(\ [concat('disks/mpathadm/mpathadm_show_LU_',basename($lun)),\ '/usr/sbin/mpathadm',concat('show LU ',quote($lun)),\ concat('---+++ Logical Unit: ',$lun)]) } var @ret = () call do_exec(\ ['disks/mpathadm/mpathadm_list_mpath-support',\ '/usr/sbin/mpathadm','list mpath-support',\ '---++ Support',{out=>{fct=>'capture_results'}}]) loop $ret (@ret) {next !match($ret,'mpath-support:') var $pth = trim(replace($ret,'mpath-support:','',true)) call do_exec(\ [concat('disks/mpathadm/mpathadm_show_mpath-support_',$pth),\ '/usr/sbin/mpathadm',concat('show mpath-support ',quote($pth)),\ concat('---+++ Path: ',$pth)]) } if ?testFile('x',$cmd = '/usr/sbin/stmsboot') call do_exec(\ ['disks/mpathadm/stmsboot-L',$cmd,'-L','---++ STMS Device Names']) call do_exec({cmd => 'UNTITLE'}) # Collect iSCSI information call do_exec({cmd => 'TITLE',txt => '---+ iSCSI Information'}) if compare('SAME',$rec->[2],'5.10') {var ($ptc,$rev) = check(get_arc(),'sparc',list('119090','26'),\ 'i386', list('119091','27'),\ list()) var $flg = check_patch($ptc,$rev) } else var $flg = compare('VALID',$rec->[2],'5.11') if $flg {var @svc = grepCommand('/usr/bin/svcs -a 2>/dev/null','iscsi') if and(grep(@svc,'^online.*iscsi/initiator'),\ testFile('x',$cmd = '/usr/sbin/iscsiadm')) call do_exec(\ {cmd => 'TITLE',txt => '---++ iscsiadm Information'},\ ['disks/iscsi/iscsiadm_list_initiator-node',\ $cmd,'list initiator-node',\ '---+++ Initiator Nodes'],\ ['disks/iscsi/iscsiadm_list_discovery',\ $cmd,'list discovery',\ '---+++ Discovery Methods and Status'],\ ['disks/iscsi/iscsiadm_list_discovery-address',\ $cmd,'list discovery-address -v',\ '---+++ All Known Targets'],\ ['disks/iscsi/iscsiadm_list_static-config',\ $cmd,'list static-config',\ '---+++ Static Targets'],\ ['disks/iscsi/iscsiadm_list_isns-server-v',\ $cmd,'list isns-server -v',\ '---+++ isns-server Objects'],\ ['disks/iscsi/iscsiadm_list_target-v',\ $cmd,'list target -v',\ '---+++ Targets'],\ ['disks/iscsi/iscsiadm_list_target-S',\ $cmd,'list target -S',\ '---+++ Detailed Targets'],\ ['disks/iscsi/iscsiadm_list_target-param-v',\ $cmd,'list target-param -v',\ '---+++ Target Parameters'],\ {cmd => 'UNTITLE'}) if and(grep(@svc,'^online.*iscsitgt'),\ testFile('x',$cmd = '/usr/sbin/iscsitadm')) call do_exec(\ {cmd => 'TITLE',txt => '---++ iscsitadm Information'},\ ['disks/iscsi/iscsitadm_list-initiator_-v',$cmd,'list initiator -v',\ '---+++ Initiators'],\ ['disks/iscsi/iscsitadm_list-target_-v', $cmd,'list target -v',\ '---+++ Targets'],\ ['disks/iscsi/iscsitadm_list-tpgt_-v', $cmd,'list tpgt -v',\ '---+++ Target Groups'],\ ['disks/iscsi/iscsitadm_show_admin', $cmd,'show admin',\ '---+++ Administrative Information'],\ {cmd => 'UNTITLE'}) } if compare('VALID',$rec->[2],'5.11') {if ?testFile('x',$cmd = '/usr/sbin/itadm') call do_exec(\ {cmd => 'TITLE',txt => '---++ itadm Information'},\ ['disks/iscsi/itadm_list-defaults', $cmd,'list-defaults',\ '---+++ Default Properties'],\ ['disks/iscsi/itadm_list-initiator_-v',$cmd,'list-initiator -v',\ '---+++ Initiators'],\ ['disks/iscsi/itadm_list-target_-v', $cmd,'list-target -v',\ '---+++ Targets'],\ ['disks/iscsi/itadm_list-tpg_-v', $cmd,'list-tpg -v',\ '---+++ Portal Group Targets'],\ {cmd => 'UNTITLE'}) if ?testFile('x',$cmd = '/usr/sbin/stmfadm') {call do_exec(\ {cmd => 'TITLE',txt => '---++ stmfadm Information'},\ ['disks/iscsi/stmfadm_list-hg_-v', $cmd,'list-hg -v',\ '---+++ Host Groups'],\ ['disks/iscsi/stmfadm_list-lu_-v', $cmd,'list-lu -v',\ '---+++ Logical Units'],\ ['disks/iscsi/stmfadm_list-state', $cmd,'list-state',\ '---+++ Operational and Configuration State'],\ ['disks/iscsi/stmfadm_list-target_-v',$cmd,'list-target -v',\ '---+++ Targets'],\ ['disks/iscsi/stmfadm_list-tg_-v', $cmd,'list-tg -v',\ '---+++ Target Groups']) loop $lin (command(concat($cmd,' list-lu 2>/dev/null'))) {var (undef,undef,$lun) = split('\s+',$lin,3) call do_exec(\ [concat('disks/iscsi/stmfadm_list-view_-l_',$lun),\ $cmd,concat('list-view -l ',quote($lun)),\ concat('---+++ View Entries for: ',$lun)]) } call do_exec({cmd => 'UNTITLE'}) } if grepCommand('/usr/sbin/modinfo 2>/dev/null','sata','f') call do_exec(\ ['disks/sata_dmsg_dump','/usr/bin/mdb','-k','---++ SATA Ring Buffer',\ {req =>{inp => "::sata_dmsg_dump\012",\ pre => "echo '::sata_dmsg_dump' |"},\ det => 'echo "::sata_dmsg_dump" | /usr/bin/mdb -k'}]) } call do_exec({cmd => 'UNTITLE'}) # Collect luxadm data again but without dump_map this time call collect_luxadm('---+ Fibre Channel Information (Second Run)',$rec->[2],\ false) # Collect NVM Express controller information if testFile('x',$cmd = '/usr/sbin/nvmeadm') {call do_exec(\ {cmd => 'TITLE',txt => '---++ NVM Express Controller Information'},\ ['disks/nvme/nvmeadm_list_-v', $cmd,'list -v',\ '---+++ Controller Information'],\ ['disks/nvme/nvmeadm_namespace_-v',$cmd,'namespace -v',\ '---+++ Namespaces Characteristics'],\ ['disks/nvme/nvmeadm_getfeature', $cmd,'getfeature',\ '---+++ Controller Features'],\ ['disks/nvme/nvmeadm_getlog_-h', $cmd,'getlog -h',\ '---+++ SMART/Health Logs']) # Get the highest number of logs to collect them all. Use 1 even when none. var $num = 1 loop $nlg (grepCommand(concat($cmd,' getlog -e 1 2>/dev/null'),\ '^Available Error Logs: (\d+)$','1')) {next expr('<=',$nlg,$num) var $num = $nlg } call do_exec(\ ['disks/nvme/nvmeadm_getlog_-e',$cmd,concat('getlog -e ',$num),\ '---+++ Available Extended Error Logs'],\ {cmd => 'UNTITLE'}) } # Collect HD tools information if is_pkg_installed('SUNWhd') {call do_exec({cmd => 'TITLE',txt => '---+ HD Tool Information'}) if ?$dir = get_pkg_base('SUNWhd','SUNWhd') {if ?testFile('x',$cmd = catFile($dir,'hd','bin','hd')) {call do_exec(\ ['disks/hd/hd', $cmd,undef,'---++ Logical Name to Slot# Mapping'],\ ['disks/hd/hd-a',$cmd,'-a', '---++ fdisk Partition Type Drives'],\ ['disks/hd/hd-g',$cmd,'-g', '---++ Drive Slot List with Temperature'],\ ['disks/hd/hd-l',$cmd,'-l', '---++ Accessible Disks'],\ ['disks/hd/hd-r',$cmd,'-r', '---++ SMART Data for Disks'],\ ['disks/hd/hd-R',$cmd,'-R', '---++ SMART Data Individual ID'],\ ['disks/hd/hd-j',$cmd,'-j', '---++ HBA Controller# and PCI Nodes'],\ ['disks/hd/hd-T',$cmd,'-T', '---++ VTOC for Drives'],\ ['disks/hd/hd-i',$cmd,'-i', '---++ cXtY, sd and PCI Path'],\ ['disks/hd/hd-o',$cmd,'-o', '---++ LSI HBA#, Target#, and cXtY List'],\ ['disks/hd/hd-x',$cmd,'-x', '---++ hd_map HTML File Generation']) call push(@fil,\ ['G','disks/hd/hd_map.html',catFile($dir,'web','hd_map.html')]) } if ?testFile('x',$cmd = catFile($dir,'hd','bin','hdadm')) call do_exec(\ ['disks/hd/hdadm-smart-all', $cmd,'smart all',\ '---++ SMART Information'],\ ['disks/hd/hdadm-read_cache-display-all',$cmd,'read_cache display all',\ '---++ Read Cache Status'],\ ['disks/hd/hdadm-write_cache-display-all',\ $cmd,'write_cache display all',\ '---++ Write Cache Status'],\ ['disks/hd/hdadm-diskqual-all', $cmd,'diskqual all',\ '---++ Hard Drive Performance Test']) call do_exec({cmd => 'UNTITLE'}) } } if and(has_zones(),${B_LOCAL:1}) call do_exec(\ {cmd => 'TITLE',txt => '---+ Zone Disk Free'},\ ['disks/df-alZ',${CMD.DF:'df'},'-alZ','---++ All'],\ ['disks/df-elZ',${CMD.DF:'df'},'-elZ','---++ Files'],\ ['disks/df-glZ',${CMD.DF:'df'},'-glZ','---++ Full'],\ ['disks/df-klZ',${CMD.DF:'df'},'-klZ','---++ Summary'],\ {cmd => 'UNTITLE'}) } else {# Gather information from local zones var @fil = () var @dir = () loop $val (command(join(' ',$exe,${CMD.FIND:'find'},\ '/dev -type d -print 2>/dev/null'))) call push(@dir,quote($val)) call do_remote($pre,$exe,$top,\ {cmd => 'TITLE',txt => '---+ Devices and Files Lists'},\ ['disks/ls-lAR_dev',${CMD.LS:'ls'},'-lAR /dev','---++ /dev'],\ ['disks/ls-ld_tmp', ${CMD.LS:'ls'},'-ld /tmp', '---++ /tmp'],\ ['disks/dev-lL',${CMD.LS:'ls'},join(' ','-lL',@dir),'---++ /dev Contents'],\ {cmd => 'TITLE',txt => '---+ Swap'},\ ['disks/swap-l','/usr/sbin/swap','-l','---++ Status'],\ {cmd => 'UNTITLE'},\ {cmd => 'TITLE',txt => '---+ Disk Free'},\ ['disks/df-al',${CMD.DF:'df'},'-al' ,'---++ All'],\ ['disks/df-el',${CMD.DF:'df'},'-el','---++ Files'],\ ['disks/df-gl',${CMD.DF:'df'},'-gl','---++ Full'],\ ['disks/df-kl',${CMD.DF:'df'},'-kl','---++ Summary'],\ {cmd => 'UNTITLE'},\ {cmd => 'TITLE',txt => '---+ Mounted Filesystems'},\ ['disks/mount',${CMD.MOUNT:'mount'},undef,'---++ Status'],\ {cmd => 'UNTITLE'}) } # Collect files prefix {write '---+ Collected files' write $WRN write '|*File Path*| *Size*|*Last Modified Date*|' } call do_collect_rem($pre,$top,@fil) if hasOutput(true) write $TOP # Add the report to the table of content if isCreated(true) toc '3:[[',getFile(),'][rda_report][',$ttl,']]' } unpretoc =head2 Zones =for zone begin disks By default, collects information from the global zone only. When local zone collections are requested explicitly, collects disks and controllers information from the selected local zones 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 =back =for zone end =head1 SEE ALSO L, 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