# M254HDS.def: Collects Hitachi Dynamic Link Manager Information # $Id: M254HDS.def,v 1.6 2012/06/06 08:56:29 mschenke Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_4/src/scripting/lib/modules/M254HDS.def,v 1.6 2012/06/06 08:56:29 mschenke Exp $ # # Change History # 20120606 PRM Improve title. =head1 NAME M254HDS - Collects Hitachi Dynamic Link Manager Information =head1 DESCRIPTION This module collects information about the Hitachi Dynamic Link Manager. =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 XPLRlib('hds') #------------------------------------------------------------------------------ # XPLR_hds section #------------------------------------------------------------------------------ section XPLR_hds # Validate the execution context if !${XPLR_GLOBAL:true} return call log_run('Processing HDS sections ...') var $dpo = is_pkg_installed('HITdpo') var $dlm = is_pkg_installed('DLManager') var $hor = testDir('d','/HORCM') if !or($dpo,$dlm,$hor) return log_info('No Hitachi software found') =head2 hds - Hitachi Dynamic Link Manager Gathers Hitachi Dynamic Link 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 =back Also collects the following 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 =cut debug ' Inside HDS collection, gathering HDS information' report hds title '---+!! Hitachi Dynamic Link Manager' title $TOC # Determine the commands and files to collect var (@cmd,@fil) = () if $dpo call push(@cmd,\ {cmd => 'TITLE',\ txt => '---+ Paths'},\ ['hds/showvpath',\ '/opt/HITdpo/bin/showvpath',undef,\ '---++ VPD information'],\ ['hds/datapath query adapter',\ '/opt/HITdpo/bin/datapath_query_adapter',undef,\ '---++ Adapters'],\ ['hds/datapath_query_device',\ '/opt/HITdpo/bin/datapath','query device',\ '---++ Devices'],\ {cmd => 'UNTITLE'}) if $dlm {var $pgm = '/opt/DynamicLinkManager/bin/dlnkmgr' call push(@cmd,\ {cmd => 'TITLE',\ txt => '---+ Hitachi Dynamic Link Manager Information'},\ ['hds/dlnkmgr_view_-sys',\ $pgm,'view -sys',\ '---++ Program information'],\ ['hds/dlnkmgr_view_-sys_-sfunc',\ $pgm,'view -sys -sfunc',\ '---++ Function settings'],\ ['hds/dlnkmgr_view_-sys_-msrv',\ $pgm,'view -sys -msrv',\ '---++ Manager'],\ ['hds/dlnkmgr_view_-sys_-adrv',\ $pgm,'view -sys -adrv',\ '---++ Alert driver'],\ ['hds/dlnkmgr_view_-sys_-pdrv',\ $pgm,'view -sys -pdrv',\ '---++ Driver'],\ ['hds/dlnkmgr_view_-path',\ $pgm,'view -path',\ '---++ Path information'],\ {cmd => 'UNTITLE'}) # Add HDLM-related files call push(@fil,\ ['hds/opt/DynamicLinkManager/log',\ '/opt/DynamicLinkManager/log','','','^dlmmgr','n'],\ ['/opt/hitachi/HNTRLib/mmap',\ 'hds/opt/hitachi/HNTRLib/mmap','','','^\.+$','nv'],\ ['hds/opt/hitachi/HNTRLib/spool',\ '/opt/hitachi/HNTRLib/spool','','','^hntr','n'],\ ['hds/opt/hitachi/HNTRLib/spool/setuplog',\ '/opt/hitachi/HNTRLib/spool/setuplog','','','^\.+$','nv']) } if $hor {call push(@cmd,\ ['hds/raidqry_-h',\ '/HORCM/usr/bin/raidqry','-h',\ '---+ Configuration of the RAID Storage System']) # Add HORCM-related files call push(@fil,\ ['hds/HORCM/etc','/HORCM/etc','','','\.conf$','n'],\ ['hds/etc', '/etc' ,'','','^horcm','n']) loop $dir (findDir('/HORCM','^log','np')) call push(@fil,\ [concat('hds',$dir),$dir,'^\.+$','drv']) } if and(testFile('f','/etc/horcm.conf'),\ testFile('x','/usr/bin/pairdisplay')) {# Select first field from each HORCM_DEV section and discards duplicates var $flg = false loop $lin (grepFile('/etc/horcm.conf','^#|^$','v')) {var $grp = field('\s+',0,$lin) if match($grp,'^HORCM_(.*)$') var $flg = compare('eq','DEV',last) elsif $flg var $grp{$grp} = 0 } # Add the commands to collect loop $grp (keys(%grp)) call push(@cmd,\ [concat('hds/HORCM/pairdisplay-g_',$grp),\ '/usr/bin/pairdisplay',concat('-g ',$grp),\ '---+ Pair Status']) } # Collect the command outputs call do_exec(@cmd) # Collect the files debug ' Inside HDS collection, collecting files' prefix {write '---+ Configuration 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*|' } call do_collect_fil(@fil) if hasOutput(true) write $TOP # Add the report to the table of content if isCreated(true) toc '2:[[',getFile(),'][rda_report][Hitachi Dynamic Link Manager]]' =head1 SEE ALSO L, L =head1 COPYRIGHT NOTICE Copyright (c) 2002, 2012, 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