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

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

Release      : EMCGrab v4.5.1

Release Date : April 3, 2013

Author       : Global Services Software Development (GSSD)

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

EMCGrab v4.5.1 changes

Changes made to module dpa.sh
	a. Add collections for DPA v5.8.x (GERS_3988)
	b. Add additional collections for DPA v6.0 (GERS_4100)

Changes made in module AIX.sh
	a.  Add syslog and syslog.conf collection (GERS_4288)

Changes made in module emcgrab.main
	a. Add gpfs collection to LITE mode - restructure of module function (GERS_4186)
	b. Add support for autodetection of S/W for SunOS 5.11 (GERS_4036)
	c. Modify name of vfCache module to Xtrem (GERS_4472)

Changes made in module emcgrab.sh
	a. Add NOINQDBG=1 setting to -lite option (GERS_4483)
	b. Add umask 022 to insure read permission across the board for grab outputs (GERS_4153)
	c. Modify excluded_files routine to allow adding more than one file (GERS_4521)

Changes made in module hbainfo.sh
	a. Add routines for Emulex & QLogic HBA utility HBA collection (GERS_4250)

Changes made in module HP-UX.sh
	a. Add command "ioscan -m hwpath" to full and lite mode (GERS_4518)

Changes made to module ing.sh
	a. Add additional messaging when not collecting INQ DEBUG info (GERS_4483)

Changes made in module Linux.sh
	a. Add "virt-what' command to run if detected (GERS_3050)
	b. Add zip to tar_files & tar_dir commands (GERS_4204)

Changes made in module pp.sh
	a. Restructure for easier maintenance and readability (GERS_4429)
	b. Add new "pkg info EMCpower" command for Solaris 11 (GERS_4036)

Changes made in module se.sh
	a. Modify module to check for a symcli bin in the event the commands are not found
           and add to PATH if found. Update for v7.5. (GERS_4419)
	b. Add "symqos -cp list -sid ${SYMCLI_SID} -settings -usage -v" command to get_symm_data function (GERS_4462)
	c. Add symfast commands to Full mode and LITE migration mode (-mig option) (GERS_4477)
	d. Remove "symdev list -passive" command from get_symm_data function (GERS_4484)
	e. Add support for SE v7.6 (GERS_4522)

Changes made in "usage_file" file
	a. Rearrange option listing (GERS_4519)

Changes made to module vfCache.sh (renamed to Xtrem.sh)
	a. Added data collection for vfStore adapter (XtremSF) and additional messaging (GERS_4278)
	b. Changed module name from vfCache.sh to Xtrem.sh; changed name vfCache to XtremCache (GERS_4472)

Changes made to EMC inquiry binaries
	a.  Replaced v7.4.0.0 of the EMC inquiry binaries to v7.5.1.0 for AIX, HP-UX, Linux and SunOS operating systems




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

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:
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) is excluded from the Module execution list.

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:

****** 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.

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:

****** 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.

*****************************************************************************************
This script is provided as a means to collect system and/or software 
configuration for 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. 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 priviledges,
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<Request Number>.tar.<Z|gz>'
depending on whether compress or gzip has been used as their compression utility.

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

Syntax :
Change directory to emcgrab

./emcgrab.sh [-h] [-v] [-o options,options] [-autoexec] [-backup] [-clariionIP <IP Addresses>] [-dpa] [-exclude]
	     [-gpfs] [-ip] [-ipmask] [-legal] [-lite] [-noinqDBG] [-mig] [-nomsg] [-nw] [-OUTDir new_output_directory]
	     [-quiet] [-smas] [-symmid bypass|prompt] [-vxdmpdebug] 
where
        -h          : Displays help screen
        -v          : Displays version information
        -o          : User defined options, Comma Separated List (See below)
        -autoexec   : Bypasses user interactive prompts (but will prompt for EMC's license if no -legal)
        -backup     : Bypasses interactive menu, when scheduled via cron.
        -clariionIP : Comma separated list of IP addresses for SPA / SPB
	-dpa        : Collect Data Protection Advisor information
        -exclude    : Allows adding a file name (file name only - no path) to the excluded_files file 
	-gpfs	    : Collects General Parallel File System Information.
	-ip         : Comma separated list of IP addresses for SPA / SPB
	-ipmask     : Will mask the ip address of the host in all the files collected in the EMCGrab
	-legal      : User automatically accepts EMC License Agreement (used with -autoexec or -quiet)
        -lite       : A reduced subset of data collection that is required by ELabAdvisor analysis server
	-mig        : Run additional SE commands in -lite mode for migration reports in ELA
	-noinqDBG   : Disables collection of inq debug information
	-nomsg      : Will not collect the messages logs
	-nw         : Collects Networker related information on AIX, HP-UX, LINUX & SunOS
        -OUTDir     : Option to store final EMCGrab file at specified location
        -quiet      : Suppress all status messages
        -smas       : Enables Symmetrix Management Console and Symmetrix Performance Analyzer log collection.
	-symmid     : bypass|prompt - Bypasses Symmetrix detailed collection or prompts for each Symmetrix detected
        -vxdmpdebug : Runs vxdmpdebug script with 'Y' option enabled
                        

Options :

This is a comma separated list of additional modules. By default these
options are not run unless automatically detected, and need to be invoked by the -o syntax.

Supported Optional modules are as follows :-

        : clariion - Must be used with -clariionIP <SPA,SPB>
        : dru - Collect data relating to the EMC Open Migrator/LM (DRU)
        : ecc - Collects configuration and log files for ECC 4.x / 5.x.
        : erm - Collects data relating to EMC Replication Manager (Autorun)
        : hacmp - To collect log files relating to AIX HACMP cluster (automatic detection)
        : ifs - Infomover File System
        : ift - Infomover File Transfer
        : im - Both ifs and ift modules
        : inq - Perform SCSI inquiry against devices (automatic detection)
        : pp - PowerPath (automatic detection)
        : ppvm - PowerPath Volume Manager (automatic detection)
        : sc - Sun Cluster 3.0. (automatic detection)
        : sdmm - Symmetrix Data Mobility Manager
        : se - Solutions Enabler (automatic detection)
        : svm - Solaris Volume Manager (automatic detection)
        : vcs - Veritas Cluster Server (automatic detection)
        : vxvm - Run Veritas Volume Manager (automatic detection)
        : rp - To collect logs on Solaris & AIX in Recover Point Environment
        : networks - Collects data relating to Devices attached to Host (automatic detection)
        : scsimgr - Collect scsimgr command output for HP-UX OS in FULL Mode

OS Support :

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

        : Solaris 7 or later
        : AIX 5.1 and later
        : HP-UX 11.xx or later
        : Tru64 4.x or later (OSF1)
        : RedHat Linux 7.x or later
        : RedHat Advanced Server 2.1 or later
        : SuSE Linux 7.x or later
        : Irix 6.5.x  or later
        : Siemens Reliant Unix 5.4.x or later

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

Module : se (Solutions Enabler)(Automatic Detection)(Full & Lite modes)
Operating Systems: AIX, HP-UX, Linux, SunOS, Tru64
A gatekeeper device should be visible to the host, for communication 
to the Symmetrix. The script will attempt to check for the existance 
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).
