# MCsade.ctl:252: Collects Storage Automated Diagnostic Environment Information # $Id: MCsade.ctl,v 1.3 2013/10/30 07:18:25 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/EXPLORER/MCsade.ctl,v 1.3 2013/10/30 07:18:25 RDA Exp $ # # Change History # 20130403 JGS Enhance validations. =head1 NAME EXPLORER:MCsade - Collects Storage Automated Diagnostic Environment Information =head1 DESCRIPTION This module collects information on devices monitored by the Storage Automated Diagnostic Environment (StorADE) utility. =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('storade') #------------------------------------------------------------------------------ # XPLR_sade section #------------------------------------------------------------------------------ section XPLR_sade # Validate the execution context if !${B_GLOBAL:true} return call log_run('Processing SADE sections ...') var $ade = is_pkg_installed('SUNWstade') var $ads = is_pkg_installed('SUNWstads') var $rsg = is_pkg_installed('SUNWrasag') if !or($rsg,$ade,$ads) return log_info('StorAde Data Services not installed') =head2 sade_cmd - Overview Gathers the Storage Automated Diagnostic Environment information using the following commands: =over 2 =item o C<${STORADE_PATH}/bin/ras_admin alert_list> =item o C<${STORADE_PATH}/bin/ras_admin device_detail> =item o C<${STORADE_PATH}/bin/ras_admin device_list> =item o C<${STORADE_PATH}/bin/ras_admin event_list> =item o C<${STORADE_PATH}/bin/ras_admin host_detail> =item o C<${STORADE_PATH}/bin/ras_admin host_list> =item o C<${STORADE_PATH}/bin/ras_admin login_list> =item o C<${STORADE_PATH}/bin/ras_admin report -k ${REPORT_KEY} -h ${HOST}> =item o C<${STORADE_PATH}/bin/ras_admin report_list> =item o C<${STORADE_PATH}/bin/ras_admin review_config> =item o C<${STORADE_PATH}/bin/ras_admin site_info> =item o C<${STORADE_PATH}/bin/ras_admin topo_list> =item o C<${STORADE_PATH}/bin/ras_revcheck -M ALL> =back =cut pretoc '2:Storage Automated Diagnostic Environment' debug ' Inside SADE collection, gathering SADE information' # Determine the base directory var $dir = get_pkg_base('SUNWstade','SUNWstade','bin') # Perform command collection when the directory is found if and(defined($dir),testDir('d',catDir($dir))) {var $adm = catFile(lastDir(),'ras_admin') # Populate table of commands to be collected var @cmd = (\ ['storade/ras_admin_alert_list',\ $adm,'alert_list',\ '---+ Alert List'],\ ['storade/ras_admin_review_config',\ $adm,'review_config',\ '---+ Configutation Review'],\ ['storade/ras_admin_device_detail',\ $adm,'device_detail',\ '---+ Device Details'],\ ['storade/ras_admin_device_list',\ $adm,'device_list',\ '---+ Device List'],\ ['storade/ras_admin_event_list',\ $adm,'event_list',\ '---+ Event List'],\ ['storade/ras_admin_host_detail',\ $adm,'host_detail',\ '---+ Host Details'],\ ['storade/ras_admin_host_list',\ $adm,'host_list',\ '---+ Host List'],\ ['storade/ras_admin_login_list',\ $adm,'login_list',\ '---+ Login List'],\ ['storade/ras_admin_report_list',\ $adm,'report_list',\ '---+ Report List'],\ ['storade/ras_admin_site_info',\ $adm,'site_info',\ '---+ Site Information'],\ ['storade/ras_admin_topo_list',\ $adm,'topo_list',\ '---+ Topology List'],\ ['storade/ras_revcheck_-M_ALL',\ catFile($dir,'ras_revcheck'),'-M ALL',\ '---+ Revision Level of all Discovered Devices']) loop $lin (grepCommand(concat(quote($adm),' report_list'),'.*','',\ undef,3)) {var (undef,$hst,undef,$key) = split('\s+',$lin,5) call push (@cmd,\ [concat('storade/ras_admin_report_-k_',$key,'_-h_',$hst),\ $adm,concat('report -k ',quote($key),' -h ',quote($hst)),\ concat('---+ Report for Host ',$hst,' and Key ',$key)]) } # Generate the report report sade_cmd title '---+!! Storage Automated Diagnostic Environment Commands' title $TOC call do_exec(@cmd) if isCreated(true) toc '3:[[',getFile(),'][rda_report][Overview]]' } =head2 sade_files - Files Gathers the Storage Automated Diagnostic Environment files from the following directory structures: =over 2 =item o F =item o F =back =cut debug ' Inside SADE collection, collecting files' report sade_files prefix {write '---+!! Storage Automated Diagnostic Environment Files' 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 or($ade,$ads) call do_collect_dir('storade/DATA','/opt/SUNWstade/DATA',true) if $rsg call do_collect_dir('storade','/opt/SUNWrasag/DATA',true) if isCreated(true) {write $TOP toc '3:[[',getFile(),'][rda_report][Files]]' } # Adjust the table of content 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