# MCsto4.ctl:259: Collects StorTools 4.x Information # $Id: MCsto4.ctl,v 1.3 2013/10/30 07:18:26 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/EXPLORER/MCsto4.ctl,v 1.3 2013/10/30 07:18:26 RDA Exp $ # # Change History # 20130404 JGS Enhance validations and code. =head1 NAME EXPLORER:MCsto4 - Collects StorTools 4.x Information =head1 DESCRIPTION Collects StorTools 4.x Information. =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('vtsst') # ----------------------------------------------------------------------------- # XPLR_vtsst section # ----------------------------------------------------------------------------- section XPLR_vtsst # Validate the execution context if !${B_GLOBAL:true} return call log_run('Processing STO4 sections ...') if !is_pkg_installed('SUNWvtsst') return log_info('StorTools Diagnostics not installed') pretoc '2: StorTools 4.x' =head2 sto4_cmd - StorTools 4.x Information Collects StorTools 4.x information using one of the following commands: =over 2 =item o C<${VTSPATH}/discman -c> =item o C<${VTSPATH}/discman -v> =back The ${VTSPATH} directory is determined from where the package has been installed and from the host processor architecture. =cut # Determine the command directory var $dir = get_pkg_base('SUNWvtsst','SUNWvtsst','bin') if grepCommand('/usr/bin/isainfo -k','sparcv9','f') var $dir = catDir($dir,'sparcv9') # Validate context and perform the collection var $osv = get_osv() if and(expr('==',$osv,8),grepFile('/etc/release','Solaris 8( 6/00)? s28','f')) var $osv = 0 if and($dir,expr('>=',$osv,8),testFile('x',catFile($dir,'discman'))) {var $arg = cond(grepDir('/var/opt/SUNWvtsst/logs',\ '^[Ss]nap[Ss]hot\.log$','f'),\ '-v','-c') report sto4_cmd title '---+!! Snapshot Information' title $TOC call do_exec([concat('vtsst/discman_',$arg),lastFile(),$arg]) if isCreated(true) toc '3:[[',getFile(),'][rda_report][Snapshot Information]]' } =head2 sto4_files - Log and Snapshot Files Collects the following log and snapshot files: =over 2 =item o F =item o F =item o F =item o F =item o F =back =cut report sto4_files title '---+!! Log and Snapshot 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.' var $dir = '/var/opt/SUNWvtsst/logs' # Collect the log files prefix {write '---+!! Log Files' write '|*File Path*| *Size*|*Last Modified Date*|' } var @fil = () loop $fil ('activity.log',\ 'sunvts.err',\ grepDir($dir,'\.errlog$','n')) call push(@fil,[concat('vtsst/',$fil),catFile($dir,$fil)]) call do_collect_fil(@fil) if hasOutput(true) write $TOP # Collect the snapshot files prefix {write '---+!! Snapshot Files' write '|*File Path*| *Size*|*Last Modified Date*|' } var @fil = () loop $fil (grepDir($dir,'^[Ss]nap[Ss]hot\.(log|diffs)$','n')) call push(@fil,[concat('vtsst/',$fil),catFile($dir,$fil)]) call do_collect_fil(@fil) if hasOutput(true) write $TOP # Add the report in the table of content if isCreated() toc '3:[[',getFile(),'][rda_report][Log and Snapshot Files]]' 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