# S401OCFS.def: Collects Oracle Cluster File System Information # $Id: S401OCFS.def,v 1.20 2009/05/10 20:07:42 mschenke Exp $ # ARCS: $Header: /u02/webapps/workbench/cvs/RDA_4/src/scripting/lib/modules/S401OCFS.def,v 1.20 2009/05/10 20:07:42 mschenke Exp $ # # Change History # 20090506 KRA Improve collection for RAC environment. =head1 NAME S401OCFS - Collects Oracle Cluster File System Information =head1 DESCRIPTION This module collects data that is related to the use of the Oracle Cluster File System and its configuration. This is currently restricted to Linux environments. The following reports can be generated and are regrouped under C: =cut echo tput('bold'),'Processing OCFS module ...',tput('off') # Initialization var $ORACLE_HOME = getSetting('ORACLE_HOME','') var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' # Limit its execution to Linux var $OSN = getOsName() if !match($OSN,'linux') {echo 'Platform ',$OSN,' not supported in the OCFS module.' return } var $ROOT = match(id(),'^uid=0\(') toc '^1:Cluster' toc '1+:OCFS' =head2 config_status - Configuration and Status Gets the OCFS package information, collects F and F, and determines the OCFS status. =cut debug ' Inside OCFS module, gathering configuration and status information' report config_status write '---+!! Oracle Cluster File System' write $TOC write '---+ OCFS Package Information' prefix write '' loop $lin (grepCommand('rpm -qa','ocfs')) write $lin if hasOutput(true) write '' else write 'OCFS is not installed%BR%' write $TOP prefix write '---+ /etc/ocfs.conf' call writeFile('/etc/ocfs.conf') if hasOutput(true) write $TOP prefix write '---+ /etc/ocfs2/cluster.conf' call writeFile('/etc/ocfs2/cluster.conf') if hasOutput(true) write $TOP prefix write '---+ /etc/sysconfig/o2cb' call writeFile('/etc/sysconfig/o2cb') if hasOutput(true) write $TOP prefix write '---+ /etc/fstab' call writeFile('/etc/fstab') if hasOutput(true) write $TOP prefix write '---+ /etc/init.d/ocfs' if statFile('b','/etc/init.d/ocfs') {var $lin = replace(command('/etc/init.d/ocfs status'),\ '\033\[[\d;]+[A-Za-z]','',true) if $lin {write '' write $lin write '' } } if hasOutput(true) write $TOP prefix write '---+ /etc/init.d/o2cb' if statFile('b','/etc/init.d/o2cb') call writeCommand('/etc/init.d/o2cb status') if hasOutput(true) write $TOP toc '2:[[',getFile(),'][rda_report][Configuration and Status]]' =head2 drives - Drives Identifies all OCFS drives and provides a report on the space that is available on the drives. =cut report drives debug ' Inside OCFS module, gathering drive information' prefix {write '---+!! Oracle Cluster File System Drives' write $TOC } loop $lin (grepCommand('/bin/mount','ocfs')) {var ($dev,undef,$nam) = split('\s+',$lin,4) var $cmd = concat('/usr/sbin/ocfsextfinder ',$dev,' 2>&1') write '---+ Space on ',$nam write '---## Using: ',$cmd call writeCommand($cmd) write $TOP } if isCreated(true) toc '2:[[',getFile(),'][rda_report][Drives]]' =head2 ocfs2_drives - OCFS2 Drives Lists OCFS2 drive information. =cut report ocfs2_drives debug ' Inside OCFS module, gathering OCFS2 drive information' var $cmd = 'mounted.ocfs2 -d' prefix {write '---+ OCFS2 Drives' write '---## Using: ',$cmd } call writeCommand($cmd) if hasOutput(true) {write $TOP toc '2:[[',getFile(),'][rda_report][OCFS2 Drives]]' } =head2 all_ocfs2_drives - All OCFS2 Drives Lists information on all OCFS2 drives. =cut if $ROOT {report all_ocfs2_drives debug ' Inside OCFS module, gathering information on all OCFS2 drives' var $cmd = 'mounted.ocfs2 -f' prefix {write '---+ All OCFS2 Drives' write '---## Using: ',$cmd } call writeCommand($cmd) if hasOutput(true) {write $TOP toc '2:[[',getFile(),'][rda_report][All OCFS2 Drives]]' } } =head2 messages - Error Messages Extracts all OCFS messages from the error log. =cut debug ' Inside OCFS module, extracting error messages' report messages prefix {write '---+!! Oracle Cluster File System Error Messages' write '---## Using: dmesg | grep ocfs' write '' } loop $lin (grepCommand('dmesg','ocfs')) write $lin if isCreated(true) {write '' toc '2:[[',getFile(),'][rda_report][Error Messages]]' } # Disable the group title in next index toc '-:Cluster' =begin credits =over 10 =item RDA 4.0: Bernhard Cock Buning, Luc Dens. =item RDA 4.6: Guido Tijskens. =item RDA 4.16: Jaime Alcoreza, Hagen Herbst, Scott Jesse, Rick Pulliam, Sanjay Singh. =back =end credits =head1 COPYRIGHT NOTICE Copyright (c) 2002-2009, Oracle. All rights reserved. =head1 TRADEMARK NOTICE Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. =cut