#---------------------------------------------------------------------------------------
# Copyright (C) by EMC Corporation, 2008-2013
# All rights reserved.
#---------------------------------------------------------------------------------------

*****************************************************************************************

Release      : EMCGrab v4.6.0

Release Date : December 9, 2013

Author       : Global Services Software Development (GSSD)

*****************************************************************************************

EMCGrab v4.6.0 changes (previous version: 4.5.1)

Changes made in module emcgrab.sh
	a. Add option -nosys to bypass recursive collection of the /sys directory on Linux (GERS_4700)
	b. Add option -nolvm to bypass collection of LVM information on AIX, HP-UX, Linux & Tru64 (GERS_4633)
	c. Add option -nofdisk to bypass running the fdisk commands on Linux (GERS_4633)
	d. Add option -novcs to bypass running the Veritas Cluster Service module (GERS_4883)
	e. Modify the routine for adding excluded files

Changes made in module emcgrab.main
	a. Add NOSYS to global variables export list (GERS_4700)
	b. Add routine to test for NOLVM to bypass collection of LVM information 
	   on AIX, HP-UX, Linux & Tru64 (GERS_4633)
	c. Add NOLVM and NOFDISK to global variables export list (GERS_4633)
	d. Add NOVCS to global variables export list (GERS_4883)

Changes made in module AIX.sh
	a. Added command brtools -V to collect SAP backup/recovery version (GERS_4681)
	b. Add "-L" option to the lsvg command to ignore the lock on the volume group (GERS_4864)
	c. Modify collection of fibre channel drivers to only those "Available"(GERS_4831)
	d. Modify running lsvg command to only those varied on (GERS_4831)

Changes made in module HP-UX.sh
        a. Added command brtools -V to collect SAP backup/recovery version (GERS_4681)

Changes made in module Linux.sh
	a. Move collection of /etc/multipath.conf from FULL to LITE/FULL mode collection (GERS_4551)
	b. Move "copy_single_file /sys/class/fc_host/host*/*" & 
	   "copy_single_file /sys/class/scsi_host/host*/*" from LITE to LITE/FULL mode collection (GERS_4592)
	c. Added command brtools -V to collect SAP backup/recovery version (GERS_4681)
	d. Added conditional statement for the -nosys option using VAR NOSYS (GERS_4700)
	e. Added conditional statement for the -nofdisk option using VAR NOFDISK (GERS_4633)
	f. Added conditional statement for the -nodf option using VAR NODF (GERS_4633)
	g. Added udevadm command for systems that have it available (GERS_4896)

Changes made in module SunOS.sh
        a. Added command brtools -V to collect SAP backup/recovery version (GERS_4681)
	b. Move stmsboot -L command to mpxio conditional section (GERS_4573)
	c. GERS_4831: Added routine to check the NODF variable for bypass of df-k command;
           Remove "svccfg archive" command (illegal command); Rearrange command executions (GERS_4831)

Changes made in module pp.sh
	a. Added support for PP v5.7 file collection and "pprootdev query" command (GERS_4909)
	b. Modified "powermt dump" collection to get xml into an xml file (GERS_4831)

Changes made in module se.sh
	a. Add command "symcfg list -features" to get_symm_data() function (GERS_4578)
	b. Add command "symcfg list -rdfg ALL" to get_symm_data() function (GERS_4586)
	c. Add command "symcfg -sid xxx list -connections -capacity to get_symm_data() function (GERS_3131)
	d. Add command "symlmf list -type se" to get_symm_data() function (GERS_3131)
	e. Restructure module to streamline and set offline commands where allowed (GERS_4831)
	f. Add commands "symsg list" & "symsg -v list" to get_symm_data function (GERS_4626)
	g. Remove "symaccess show view ${ARG} -sid ${SYMCLI_SID}" command; 
	   Remove duplicate symaccess backup command (GERS_4566)

Changes made in module vcs.sh
	a. Add condition to check of -novcs option (NOVCS variable) (GERS_4883)

Changes made in module vxvm.sh
	a. Add parsing in SunOS of modinfo command for vxdmp, vxio & vxspec driver
           versions & info to new file "vxvm_driver_info.txt" (GERS_4676)

Changes made in module inq.sh
	a. Add condition for running the "powerprotect" command (GERS_4831)

Changes made in module hacmp.sh
	a. Add new path for collecting hacmp.out files (GERS_4789)

Changes made in module zfs.sh
	a. Delete "zpool import" command (GERS_4573)

Changes made in file usage_file
	a. Added the -nosys option to usage file (GERS_4700)
	b. Added the -nolvm option to usage file (GERS_4633)
	c. Added the -nofdisk option to usage file (GERS_4633)
	d. Added the -noclariion option to usage file (GERS_4831)

Changes made in bin directory
	a. Installed Inquiry version 7.6.1.0 for AIX, HPUX, Linux and Solaris operating systems
	b. Updated related .txt files for Inquiry versions


*****************************************************************************************

PERFORMANCE DEGRADATION NOTICE:
On some hosts, where high I/O is a normal course of events,
running the EMCGrab utility may cause some performance
degradation when running some commands. 

Best practices should prevail, such as running EMCGrab at off peak hours
*****************************************************************************************

IMPORTANT NOTICES FOR ALL OS:

1. There are no pre-requisites to running the EMCGrab scripts.

2. If the EMCgrab is run with the -autoexec feature enabled and the host uses naviseccli 
   (in case of navicli is not found) then in order to collect Clariion information, the 
   security file should have been already created using -AddUserSecurity option of naviseccli.
   If that file is absent then EMCGrab will not collect any clariion information. Also, 
   modules like networker (-nw) are excluded from the Module execution list.

3. If a Symmetrix is attached to a host and if the symmetrix devices are not enabled for 
   masking then, while running the symmaskdb and symaccess commands you can encounter 
   a message as: 
   "No device masking database records could be found for the specified input parameters"

IMPORTANT NOTICES FOR SOLARIS:

1. ****** Before running EMCgrab please take note of these ETAs ******

   ETA emc108113: PowerPath 4.4 / 4.3.1: SYMCLI commands hang or fail.
   HBA goes Offline/Online. This issue is resolved in SAN release 4.4.9
   for Solaris 8 & 9. For Solaris 10, fix included in 119130-17.
 
   ETA emc121607: Solutions Enabler: Solaris Leadville MPxIO segments 
   Solution Enabler communication through multi-path gatekeepers or
   other data devices.

2. Solaris 5.9: If patch 114476 is installed, if at revision 04 or less,
   may cause a panic when running hbainfo commands. Install patch
   114476-05 or greater to prevent the panic. Ref: emc118999

IMPORTANT NOTICES for AIX:

1. ****** Before running EMCgrab please take note of these ETAs ******

   ETA emc111737: AIX 5.3 ML2 host crashes when pass-through I/O 
   is performed. APAR IY70336 or AIX 5.3 ML3 resolves this issue.

   ETA emc110417: AIX lspath may report a path as enabled when it
   has actually been removed. This may cause a system failure.
   APAR IY70336 or AIX 5.3 ML3 resolves this issue.

   ETA emc178626: EMC ControlCenter: Recent IBM patches to AIX may result 
   in system crash when using ControlCenter, Solutions Enabler or inq.
   Contact IBM for details regarding a fix for AIX 5.2 TL10 SP4,
   APAR IZ11999 resolves this issue for AIX5.3 TL6 SP4, 
   APAR IZ11908 resolves this issue for AIX5.3 TL7 SP1, 
   APAR IZ13376 resolves this issue for AIX6.1 SP2.

IMPORTANT NOTICE for LINUX:

1. On all flavors of Linux, the copying of certain system files may cause a hang of 
   the EMCGrab scripts or a hang of the system itself. These hangs are not a "bug"
   in the EMCGrab scripts, but rather a result of attributes related to the particular
   file(s) being copied or operating system on which the EMCGrab is running.
   Over the past several years we have identified at least 41 files that cause this
   condition and have added them to the "excluded_files" file, which is a list of files
   that EMCgrab exclude from being copied to prevent this issue. If you should encounter
   this condition, the file name can be added to the 'excluded_files' file in the 
   following manner:
   Run the emcgrab using the "-exclude <filename>" option; 
   e.g., ./emcgrab.sh -exclude <filename> OR ./emcgrab.sh -exclude "filename1 filename2 ..."

   Once this is done, re-run the emcgrab in your normal manner.
   PLEASE NOTE: There may be more than one file that needs to be excluded in the above manner.
   Please send a note mentioning the file name you added so we can update the next release of
   emcgrab with this information: gstools@emc.com
*****************************************************************************************
This script is provided as a means to collect system and/or software 
configuration for host remediation purposes and issues investigations by EMC.

To Install :
Please Note: DO NOT copy directory structures of already installed emcgrab to different locations
as this will cause problems with the emcgrab pathing structure. Please install only from extracting
the .tar file as follows:

If a previous version is installed:
Remove any previous versions of EMCGrab in the following manner: 
1. cd to the directory where the emcgrab is installed (e.g., /usr/emc/emcgrab)
2. If file customer.profile is present in the emcgrab directory, save to working directory
   e.g., mv customer.profile ../
3. cd ../; rm -rf emcgrab (removes the entire emcgrab directory and its contents)

New install or new version install:
1. Place the EMCGrab tar file into a suitable directory (e.g., /usr/emc) and extract using the following command: 
	command: tar -xvf emcgrab_<os>_<version>.tar  

2. A directory named 'emcgrab' will be created and will contain all the necessary support scripts and functions
   to successfully run the data collection scripts.

3. Please ensure that your filesystem has at least 500M of free disk space for temporary files that may be
   generated during its processing. If their are many Symmetrix' attached to the host or you are running ECC 5.x+,
   the resulting tar file could be very large.

Please NOTE:

1. The script will prompt the user with a warning message
   should it detect less than 50MB remaining on the file system every time the
   script runs the file system check routine unless run in -autoexec mode.
   Each time the user will have the option of continuing or aborting the script.

2. The script will prompt for EMC license agreement unless in -autoexec or -backup mode
   with the -legal option. Once EMC license agreement is accepted, the script will continue.
   Invoking the emcgrab script with the -legal option implies the user accepts the EMC license agreement.

Operation :
The script should be run as user root or sudo with root privileges,
to prevent any data not being collected through lack of permissions.

The scripts defines a PATH environment based on the default installation paths
of it's software.  If these are different, some modules may not work.

It is possible that some commands could run for a lengthy period. Each module
has a max runtime limit, ranging from 60 seconds through to 450, depending
on the module.

The script will generate a compressed tar file, residing in the ./emcgrab/outputs
directory unless the -OUTDir option is used to change it.  Its format will be 
'<hostname>_YYYY-mm-dd-hh.mm.ss>_<OS>_emcgrab_<version>_[full | lite]_CC<ServiceRequestNumber>.tar.<Z|gz>'.

If no Service Request number is defined, <ServiceRequestNumber> will default to 0000000000

To obtain a grab output for host remediations via E-LabAdvisor, run the grab in LITE mode (-lite option)

Syntax :
Change directory to emcgrab

./emcgrab.sh  [<options>]

For options help: ./emcgrab.sh -h

OS Support :

This version of EMCGrab is tested and supported on the following Operating Systems

        : AIX 5.1 or later (emcgrab_AIX_vx.x.x.tar)
        : HP-UX 11.xx or later (emcgrab_HP-UX_vx.x.x.tar)
	: Oracle Linux 4 or later (emcgrab_Linux_vx.x.x.tar)
        : Oracle Solaris 8 or later (emcgrab_SunOS_vx.x.x.tar)
        : Red Hat Enterprise Linux (RHEL) 3.x or later (emcgrab_Linux_vx.x.x.tar)
        : SGI Irix 6.5.x  or later (emcgrab_IRIX_vx.x.x.tar)
        : SuSE Linux 9.x or later (emcgrab_Linux_vx.x.x.tar)
        : Tru64 5.x or later (OSF1) (emcgrab_Tru64_OSF1_vx.x.x.tar)

During normal operation, it is possible that some commands will report 
"Not Found", as the command may not be in the PATH environment. This is normal.

Host : HP-UX

If BCV and / or RDF2 devices are presented to the host and they are in a 
'Not Ready' state, then ioscan may timeout.

Module Support :

Module : clariion (Clariion Storage) (automatic detection)
Operating Systems : AIX, SunOS, HP-UX and Linux
This requires Navisphere commands to be installed on the host platform.
The IP addresses will be automatically detected for any SP where devices are
visible to the host. You can define additional IP addresses through the use
of the -clariionIP command line option

Module : dpa (EMC Data Protection Advisor) (Optional)
Operating Systems: AIX, HP-UX, Linux, SunOS
Collects configuration and log files for DPA. No known issues.

Module : dru (EMC Open Migrator/LM) (Optional)(Full mode only)
Operating Systems : AIX, HP-UX, Linux, SunOS, Tru64
Runs stormigrator commands, lists configured sessions and collects logs for
last 14 days. No known issues.

Module : ecc (EMC Control Center) (Optional)(Full mode only)
Operating Systems : AIX, HP-UX, Linux, SunOS, Tru64
Predominately configured to collect ECC 5.x information.

Module: erm (EMC Replication Manager) (Automatic detection) (Full mode only)
Operating Systems : AIX, HP-UX, Linux, SunOS
Collects ERM data. No known problems.

Module : gspf (optional)
Operating Systems : AIX, Linux
Collects General Parallel File System Information.

Module : hacmp (AIX HACMP cluster) (Automatic Detection) (Full & Lite mode)
Operating Systems : AIX
Only collects log files.

Module : ifs (EMC Infomover File System)(Optional)(Full mode only)
Operating Systems : AIX, HP-UX, Linux, SunOS
Collects configuration and log files for last 14 days. No known issues.

Module : ift (EMC Infomover File Transfer)(Optional)(Full mode only)
Operating Systems : AIX, HP-UX, Linux, SunOS
Collects configuration and log files for last 14 days. No known issues.

Module : im (EMC Infomover)(Optional)(Full mode only)
Operating Systems : AIX, HP-UX, Linux, SunOS
Runs both the ift and ifs modules above. No known issues.

Module : inq (Automatic Detection)(Full & Lite modes)
Operating Systems: AIX, HP-UX, Irix, Linux, Reliant-UNIX, SunOS, Tru64
This is run by default to assist with automatic detection of Clariion,
Symmetrix and third party Storage Arrays

Module : networker (optional)
Collect networker files and information
No known problems

Module : networks (network connection)
This is run by default with all operating systems
Collects Information of all devices connected to Host. 
No known problems.

Module : pp (Powerpath) (Automatic Detection)(Full & Lite modes)
Operating Systems : AIX, HP-UX, Linux, SunOS, Tru64
Will automatically detect whether PowerPath Volume Management features
are in use, and invoke module ppvm (requires PP 4.x or later)

Module : ppvm (EMC PowerPath Volume Manager) (Automatic Detection)
No limitations known at this time.

Module : rp (Recover Point) (optional)
Operating Systems: AIX, SunOS
Collects logs in Recover Point Environment.

Module : sc (Sun Cluster 3.x) (Automatic Detection)(Full & Lite modes)
Operating Systems: AIX, HP-UX, Linux, SunOS, Tru64
Collects all information relating to Sun Cluster.  Currently only version 3.x 
is supported.  

Module : scsimgr (optional)
Operating Systems: HP-UX
Collects scsimgr command execution output in FULL Mode.

Module : sdmm (Symmetrix Data Mobility Manager) (Optional)
Operating Systems: AIX, HP-UX, Linux, SunOS
No limitations known at this time

of a gatekeeper, and it this check fails, you will have the option to 
abort the remainder of this module. Some commands may not return any output,
depending on whether the relevant Solutions Enabler license has been installed.

Module : smas (EMC Symmetrix Management Console & Performance Analyzer) (Optional)
Operating Systems: AIX, HP-UX, Linux, SunOS
Collects SMC & SPA configuration and log information

Module : svm (Solaris Volume Manager / Solstice(Online) Disk Suite (Automatic Detection)(Full & Lite modes)
Supports SDS / ODS 4.x, even though configuration paths changed 
between 4.2 and 4.2.1. 

Module : vcs (Veritas Cluster Server)(Automatic Detection) (Full & Lite modes)
Operating Systems: AIX, SunOS, HP-UX and Linux
Collects information relating to Veritas Cluster Server.  

Module : vfCache (Full and Lite modes)
Operating Systems:  AIX, SunOS, HP-UX and Linux
Collects information about EMC vfCache 

Module : vxvm (Veritas Volume Manager)(Automatic Detection) (Full & Lite modes)
Operating Systems:  AIX, SunOS, HP-UX and Linux
Collects information relating to Veritas Volume Manager.

Module : ZFS (Automatic Detection) (Full mode only)
Operating Systems: SunOS
Collects Zetta file system information.

Return Codes :

        0 - Success
        1 - Failed to source emcgrab.main
        2 - Unable to create temporary working directory
        3 - EMCGrab Data Collection already running.  Only a single instance
            is supported at any time.
        4 - Script Aborted.  Less than 25Mb of space detected on FileSystem.
        5 - Failed to create output tarfile
        6 - Override for non 'root' user operation failed.
        7 - File and directory dependencies not found.

Sending the report file to EMC:

Once you have created your report file you need to send it to EMC Customer 
Service for analysis. This is done easily and securely using EMC WebSupport.

Go to WebSupport Case Management (Note: You must be a registered WebSupport
user.  Select the registration link to register) 

For a new support case select 'Create a Case' and complete the simple
step-by-step creation process. Once you submit your case you will have the
opportunity to upload your EMC Grab file to your case using the 'Attachments'
functionality. 

For an existing Support case, locate your case by using the 'Quick Case Search'
or 'My Open Cases' portlets or by using the 'Case Query' functionality in
'Case Management.' Select the 'Attachments' tab and upload your file.

Note: You may also use EMC's ftp site if WebSupport is not available.
Contact EMC Customer Service for more information.

Uploading the output file to E-Lab Advisor (HEAT replacement)

You may also upload the output file to our analysis server (E-Lab Advisor) for analysis.
This server can be accessed through 
    PowerLink Home > Support > Product and Diagnostic Tools > Environment Analysis Tools
    or directly to 
    https://elabadvisor.emc.com (a PowerLink account is required).
