# M247FMA.def: Collects Fault Management Architecture Information # $Id: M247FMA.def,v 1.1 2012/08/12 09:59:14 mschenke Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_4/src/scripting/lib/modules/M247FMA.def,v 1.1 2012/08/12 09:59:14 mschenke Exp $ # # Change History # 20120611 PRO Initial version. # =head1 NAME M247FMA - 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 XPLRlib('fma') # ----------------------------------------------------------------------------- # XPLR_fma section # ----------------------------------------------------------------------------- section XPLR_fma # Validate the execution context if !${XPLR_GLOBAL:true} return call log_run('Processing FMA sections...') # Check OS Version if expr('<',get_osv(),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 =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)'],\ ['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'),\ '---+ Plugins 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', $cmd = '/usr/sbin/fmadm') {loop $mod (grepCommand(join(' ',$cmd,'config'),'^(\S+)','1',undef,2)) call push(@cmd,\ {cmd => 'TITLE',\ txt =>concat('---++ Module : ',$mod)},\ [concat('fma/fmstat-a-m',$mod),\ $cmd,concat(' -a -m ',$mod),\ '---+++ All Statistics'],\ [concat('fma/fmstat-s-m',$mod),\ $cmd,concat(' -s -m ',$mod),\ '---+++ Software Error Rate Discrimination (SERD)'],\ {cmd => 'UNTITLE'}) } # For each UUID, add log viewer commands if testFile('f', $cmd = '/usr/sbin/fmdump') {var ($cnt,%tbl) = (0) 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 =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/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 Solaris 10 and previous versions: =over 2 =item o F =item o F =back For Solaris 11 and later versions: =over 2 =item o F =item o F =back =cut debug ' Inside FMA collection, gathering FMA log files' # Generate the report report fma_log prefix {write '---+!! Fault Management Architecture Log Files' write $WRN write '|*File Path*| *Size*|*Last Modified Date*|' } var $pat = cond(expr('>=',get_osv(),11),\ '^(errlog|fltlog|infolog|infolog_hival)',\ '^(errlog|fltlog)') call do_collect_fil(['fma/var/fm/fmd','/var/fm/fmd','','',$pat,'n']) if isCreated(true) {write $TOP toc '3:[[',getFile(),'][rda_report][Log Files]]' } # Adjust the table of contents unpretoc =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