# MCfma.ctl:247: Collects Fault Management Architecture Information # $Id: MCfma.ctl,v 1.9 2016/02/02 14:57:49 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/EXPLORER/MCfma.ctl,v 1.9 2016/02/02 14:57:49 RDA Exp $ # # Change History # 20160202 MMC Fix version check. =head1 NAME EXPLORER:MCfma - Collects Fault Management Architecture Information =head1 DESCRIPTION This module collects Fault Management Architecture 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]]' 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('fma') # ----------------------------------------------------------------------------- # XPLR_fma section # ----------------------------------------------------------------------------- section XPLR_fma # Validate the execution context if !${B_GLOBAL:true} return call log_run('Processing FMA sections...') # Check OS Version var $osv = get_solaris_version() if compare('OLDER',$osv,'5.10') return log_info('The operating system version must be 5.10 or later') =head2 fma_cmd - Commands Collects Fault Management Architecture 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 (on Solaris 11.2 SRU 8.4 or later) =item o C =item o C =item o C =item o C =item o C =item o C =item o C =back ${ARCH} represents the machine hardware name. Its value is obtained from the C command. For each Module name (MOD) returned by the C command, it collects the following commands: =over 2 =item o C =item o C =back For each Universal Unique Identifier (UUID), it collects the following commands: =over 2 =item o C =item o C =item o C =item o C =back This collection is performed only when the F command returns less than 50 distinct Universal Unique Identifiers. =cut pretoc '2: Fault Management Architecture' var @cmd = () call push(@cmd,\ ['fma/fmadm-config',\ '/usr/sbin/fmadm','config',\ '---+ Configuration'],\ {cmd => 'TITLE',\ txt => '---+ Resources Information'},\ ['fma/fmadm-faulty',\ '/usr/sbin/fmadm','faulty',\ '---++ Resource List'],\ ['fma/fmadm-faulty-a',\ '/usr/sbin/fmadm','faulty -a',\ '---++ All Faults'],\ ['fma/fmadm-faulty-i',\ '/usr/sbin/fmadm','faulty -i',\ '---++ Persistent Cache Identifier'],\ {cmd => 'UNTITLE'},\ {cmd => 'TITLE',\ txt => '---+ Log Viewer'},\ ['fma/fmdump',\ '/usr/sbin/fmdump',undef,\ '---++ Fault Log Dump'],\ ['fma/fmdump-av',\ '/usr/sbin/fmdump','-av',\ '---++ Fault Log Dump (Very Verbose Event Details)']) if or(compare('VALID',$osv,'5.11.3'),\ and(compare('SAME',$osv,'5.11.2'),\ compare('VALID',\ first(grepCommand('/usr/bin/pkg list -H entire',\ '^[^\-]*\-[^\.\-]*(\.\d+){2}\.(\d+(\.\d+){2})\.\d','f2')),\ '8.0.4'))) call push(@cmd,\ ['fma/fmdump-iv',\ '/usr/sbin/fmdump','-iv',\ '---++ I/O Domain Resiliency Log Dump']) call push(@cmd,\ ['fma/fmdump-e',\ '/usr/sbin/fmdump','-e',\ '---++ Error Log Dump'],\ ['fma/fmdump-eV',\ '/usr/sbin/fmdump','-eV',\ '---++ Error Log Dump (Very Verbose Event Details)'],\ ['fma/fmdump-V',\ '/usr/sbin/fmdump','-V',\ '---++ Very Verbose Event Details'],\ {cmd => 'UNTITLE'},\ ['fma/fmtopo-V',\ '/usr/lib/fm/fmd/fmtopo','-V',\ '---+ Topology Information'],\ ['fma/fmtopo-x',\ '/usr/lib/fm/fmd/fmtopo','-x',\ '---+ Topology Map'],\ ['fma/plugins_ls-l',\ '/usr/bin/ls',\ concat('-l /usr/platform/',uname('m'),'/lib/fm/fmd/plugins \ /usr/lib/fm/fmd/plugins'),\ '---+ Plug-ins Information'],\ {cmd => 'TITLE',\ txt => '---+ Statistics'},\ ['fma/fmstat',\ '/usr/sbin/fmstat',undef,\ '---++ Global'],\ ['fma/fmstat-a',\ '/usr/sbin/fmstat','-a',\ '---++ Fault Manager'],\ ['fma/fmstat-t',\ '/usr/sbin/fmstat','-t',\ '---++ Event Transport'],\ ['fma/fmstat-T',\ '/usr/sbin/fmstat','-T',\ '---++ Authorities'],\ {cmd => 'UNTITLE'}) # For each module, add statistics commands if ?testFile('f','/usr/sbin/fmadm') {loop $mod (grepCommand(concat(last,' config'),'^(\S+)','1',undef,2)) call push(@cmd,\ {cmd => 'TITLE',\ txt =>concat('---++ Module : ',$mod)},\ [concat('fma/fmstat-a-m',$mod),\ '/usr/sbin/fmstat',concat(' -a -m ',$mod),\ '---+++ All Statistics'],\ [concat('fma/fmstat-s-m',$mod),\ '/usr/sbin/fmstat',concat(' -s -m ',$mod),\ '---+++ Software Error Rate Discrimination (SERD)'],\ {cmd => 'UNTITLE'}) } # For each UUID, add log viewer commands if ?testFile('f','/usr/sbin/fmdump') {var ($cnt,%tbl) = (0) var $cmd = lastTestCommand() loop $lin (grepCommand($cmd,'(\w{8}-\w{4}-\w{4}-\w{4}-\w{12})','1')) var $tbl{$lin} = incr($cnt) if expr('<',$cnt ,50) {loop $uid (keys(%tbl)) call push(@cmd,\ {cmd => 'TITLE',\ txt => concat('---++ Universal Unique Identifier ',$uid)},\ [concat('fma/fmdump-eu_',$uid),\ $cmd,concat(' -eu ',$uid),\ '---+++ Error Log Events'],\ [concat('fma/fmdump-eVu_',$uid),\ $cmd,concat(' -eVu ',$uid),\ '---+++ Error Log Events (Very Verbose Event Details)'],\ [concat('fma/fmdump-u_',$uid),\ $cmd,concat(' -u ',$uid),\ '---+++ Fault Log Events'],\ [concat('fma/fmdump-vu_',$uid),\ $cmd,concat(' -vu ',$uid),\ '---+++ Fault Log Events (Verbose Event Details)'],\ [concat('fma/fmdump-Vu_',$uid),\ $cmd,concat(' -Vu ',$uid),\ '---+++ Fault Log Events (Very Verbose Event Details)'],\ {cmd => 'UNTITLE'}) } } # Generate the report debug ' Inside FMA collection, gathering FMA commands' report fma_cmd title '---+!! Fault Management Architecture Information' title $TOC call do_exec(@cmd) if isCreated(true) toc '3:[[',getFile(),'][rda_report][Commands]]' =head2 fma_cfg - Configuration Files Collects the following Fault Management Architecture configuration files: =over 2 =item o F =item o F =item o F =item o F =back ${ARCH} represents the machine hardware name. Its value is obtained from the C command. Collects files from the following directories: =over 2 =item o F (Recursive) =item o F (Recursive) =back =cut debug ' Inside FMA collection, gathering FMA configuration files' # Generate the report report fma_cfg prefix {write '---+!! Fault Management Architecture Configuration Files' write $WRN write '|*File Path*| *Size*|*Last Modified Date*|' } var $dir = catDir('/usr','platform',uname('m'),'lib','fm','fmd','plugins') call do_collect_fil(\ ['fma/etc/devices/retire_store','/etc/devices/retire_store'],\ ['fma/etc/fm/fmd/fmd.conf','/etc/fm/fmd/fmd.conf'],\ ['fma/conf' ,'/usr/lib/fm/fmd/plugins','','','\.conf$','n'],\ ['fma/conf' ,$dir ,'','','\.conf$','n'],\ ['fma/var/fm/fmd/rsrc' ,'/var/fm/fmd/rsrc' ,'true'],\ ['fma/var/fm/fmd/topo' ,'/var/fm/fmd/topo' ,'true']) if isCreated(true) {write $TOP toc '3:[[',getFile(),'][rda_report][Configuration Files]]' } =head2 fma_log - Log Files Collects the following Fault Management Architecture log files. For Oracle Solaris 10 and later versions: =over 2 =item o F =item o F =back For Oracle Solaris 11 and later versions: =over 2 =item o F =item o F =back =cut debug ' Inside FMA collection, gathering FMA log files' # Determine the collection period if ${B_INCR_MODE} {var ($beg,$end) = (${STA.EXPLORER.XPLR.FMA.G_LAST_INCR},time()) if !?$beg var $beg = expr('-',$end,7776000) # 90 * 86400 } else var ($beg,$end) = () # Generate the report report fma_log prefix {write '---+!! Fault Management Architecture Log Files' if ?$end {write ' * Incremental collection mode activated:' write ' * Period start: ',gmtime('%d-%b-%Y %H:%M:%S',$beg),' UTC' write ' * Period end: ',gmtime('%d-%b-%Y %H:%M:%S',$end),' UTC' } write $WRN write '|*File Path*| *Size*|*Last Modified Date*|' } var $pat = cond(expr('>=',get_osv(),11),\ '^(errlog|fltlog|infolog|infolog_hival)',\ '^(errlog|fltlog)') var @fil = () loop $fil (get_modified_files($beg,$end,'/var/fm/fmd',$pat)) call push(@fil,\ [concat('fma/var/fm/fmd/',$fil),catFile('/var/fm/fmd',$fil),true]) call do_collect_fil(@fil) if isCreated(true) {write $TOP toc '3:[[',getFile(),'][rda_report][Log Files]]' } # Store the new time stamp if ?$end var ${STA.EXPLORER.XPLR.FMA.G_LAST_INCR:'Last incremental collection'} = $end # 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