Capture_Script_Version_022817
16:23:40.020066650

LSI HBA/MegaRAID/Expander/3ware Data collection script for Linux, FreeBSD, Solaris X86 and VMWare.
This script will collect system logs and info as well as controller, disk and
enclosure info for debugging purposes. All files included in the original
lsigetlunix_xxxxxx.tgz file MUST be kept in the same subdir as lsigetlunix.sh.
You MUST have root access rights to run this script, su/sudo/root./. The
latest version of this script as well as information on what data can be collected manually
can be found at;

http://www.avagotech.com/support/knowledgebase/1211161499563/lsiget-data-capture-script

OR

ftp0.lsil.com
User:tsupport
Password:tsupport
/outgoing_perm/CaptureScripts  (Sometimes newer scripts than KB article)
/outgoing_perm/CaptureScripts/BETA  (Latest and greatest)

To automatically get the latest script you can download the following file & grep for the current
latest file. This ensures support will always have access to the latest data to speed up the support
process.

Example;

/outgoing_perm/CaptureScripts/Latest_Script_Versions.txt
#Used for automated remote script updates
LatestFreebsd#lsigetfreebsd_062012.tgz
LatestLinux#lsigetlinux_062012.tgz
LatestLunix#lsigetlunix_062012.tgz
LatestMacOS#lsigetmacos_062012.tgz
LatestSolaris#lsigetsolaris_062012.tgz
LatestWin#lsigetwin_062012.tgz

This script is being packaged for all supported linux/Unix based OS's
together as well as individually for each OS with different bundled
utilities. The exact same script is used in all cases, this is being done
to cut down on the size of the full .tgz file.

	lsigetlunix_xxxxxx.tgz   - Linux/Unix - FreeBSD/Linux/Solaris/VMWare
	lsigetfreebsd_xxxxxx.tgz - FreeBSD
	lsigetlinux_xxxxxx.tgz   - Linux
	lsigetmacos_xxxxxx.tgz   - MacOS (MacOS - Not currently tested, code not removed though)
	lsigetsolaris_xxxxxx.tgz - Solaris
	lsigetvmware_xxxxxx.tgz  - VMWare

Command Line Options:
lsigetwin [Comment] [Option(s)]
Comment: Enclose noncontiguous strings in double quotes My Comments
Option:
-UMS		= Use MegaCli Syntax in addition to native storcli syntax.
-EXT		= EXTRACT - Extracts all available utilities for use.
-P		= PRINT filename in .\LSICAPTUREFILES.TXT for scripting.
-PT            	= Append the PRINTED filename of the lsiget output file with TRIGGERED, used to differentiate automated captures.
-D		= Working DIRECTORY is not deleted.
-Q		= QUIET Mode - No keystrokes required unless error.
-B		= BATCH Mode - No keystrokes required.
-E_RB          	= Clear and ENABLE 3MB Ring Buffer for all SAS HBA's. Captured automatically on next lsiget.
-E_SAS2LOG     	= ENABLE ALL SAS2 HBA Driver Logging, Option ffffffh. HUGE /var/log/messages file size! (Linux Only)
-E_SAS2LOG1    	= ENABLE some SAS2 HBA Driver Logging, Option 3f8h. Very Large /var/log/messages file size! (Linux Only)
-E_SAS3LOG     	= ENABLE ALL SAS3 HBA Driver Logging, Option ffffffh. HUGE /var/log/messages file size! (Linux Only)
-E_SAS3LOG1    	= ENABLE some SAS3 HBA Driver Logging, Option 3f8h. Very Large /var/log/messages file size! (Linux Only)
-E_SAS2LOG_RB  	= ENABLE ALL SAS2 HBA Driver Logging and Clear and ENABLE 3MB Ring Buffer for all SAS HBA's. (Linux Only)
-E_SAS2LOG1_RB 	= ENABLE 3f8h SAS2 HBA Driver Logging and Clear and ENABLE 3MB Ring Buffer for all SAS HBA's. (Linux Only)
-E_SAS3LOG_RB  	= ENABLE ALL SAS3 HBA Driver Logging and Clear and ENABLE 3MB Ring Buffer for all SAS HBA's. (Linux Only)
-E_SAS3LOG1_RB 	= ENABLE 3f8h SAS3 HBA Driver Logging and Clear and ENABLE 3MB Ring Buffer for all SAS HBA's. (Linux Only)
-D_SAS2LOG     	= Disables ALL SAS2 HBA Driver Logging, Option 000000h (Default). (Linux Only)
-D_SAS3LOG     	= Disables ALL SAS3 HBA Driver Logging, Option 000000h (Default). (Linux Only)
-E_AEC		= Clear and ENABLE AEC.
-E_DPMSTAT	= Clear and ENABLE DPMSTAT.
-E_AEC_DPMSTAT	= Clear and ENABLE AEC and DPMSTAT.
-G_AEC		= Disable and GET AEC Logs.
-G_DPMSTAT	= Disable and GET DPMSTAT Logs.
-G_AEC_DPMSTAT	= Disable and GET AEC and DPMSTAT Logs.
-M		= MONITOR Mode - Standard capture, daily/targeted logging.
-MRWA          	= MegaRAID Work Around - Limit commands for compatibility issues with old code
-H		= This Help Screen.

The following command line options are NOT standard and may be detrimental
to a root cause analysis of your issue. Used for repetitive data collection
and script debugging, these are fluid and may change.

-SRS		= Skip MegaRAID AEN Record Sort, NOT standard.
-SRC		= Skip MegaRAID AEN Record Capture and Sort, NOT standard.
-SCDA (CDA not enabled yet) = Skip Controller Disk Association, NOT standard.
-SMR		= Skip MegaRAID DATA Capture, NOT standard.
-S3W		= Skip 3Ware DATA Capture, NOT standard.
-SHBA		= Skip HBA DATA Capture, NOT standard.
-SEXP		= Skip Expander DATA Capture, NOT standard.
-SC		= Skip Compression of output subdirectory, NOT standard.
-SX            	= Skip xutil and g3xutil for debugging purposes, dependent on the SG driver in linux.
-SN            	= Skip ifconfig and ipmitool lan print data capture, used for on site and MSM debugging but can be omitted.
-F1		= FAST-1, -SRC, NOT standard (matches Windows, no -SWR switch).
-F2		= FAST-2, combines -SRC/-SCDA, NOT standard.
-F3		= FAST-3, combines -SRC/-SCDA, NOT standard (matches Windows, no -SWR switch).
-F4		= FAST-4, combines -SRC/-SCDA/-SC, NOT standard (matches Windows, no -SWR switch).

Example ./lsigetlunix.sh -D -Q "This is my comment"
Runs the standard script leaving the working directory, without prompts
and leaves a comment.

Example ./lsigetlunix.sh -Q "This is my comment" -D -M
Runs the standard script leaving the working directory, without prompts
and leaves a comment, once done the script stays resident in Monitor Mode.

Notes:
Send just the created .tar.gz file as is to your support rep.

AEC = Advanced Event Capture - Do NOT use AEC without being directed to by
Technical Support or an FAE as it requires proprietary tools to decipher.

DPMSTAT = Disk Performance Monitoring Statistics - Captures performance
related information on a controller/disk basis for the 3Ware 9650 or
the MegaRAID 9260/60 or later controllers.

-E_SASxLOG = This sets the HBA Driver logging level, -E_SAS2LOG is for all
SAS2 HBAs and -E_SAS3LOG is for all SAS3 HBAs. This is VERY VERBOSE!

All of the -E/D/G options can only be used alone.

All of the -G_* GET Options are done automatically if AEC or DPMSTAT was
enabled previously with the -E_* "ENABLE" options by default. The -G_*
options are meant for quick repetitive results without getting other system
information. Normally you should run the standard ./lsigetlunix.sh file without
a -G_* option to provide as much info as possible.

If there are competing comments the lowest variable number wins.
If there are contradictory options the lowest variable number with the
option order listed in the help wins. Valid combinations would be;
-D or -D with -B or -Q any -E_* or -G_* option by itself or in conjunction
with a -D and -B/-Q option. -E_* is allowed with -D but has no effect as
there is no working directory created.

Monitor Mode = Runs the standard capture script and then remains resident
logging "show diag" approx. every 24 hours and also monitors for three
specific AEN's (Controller Reset/Degraded Array/Rebuild Started). If any
of these are encountered a final "show diag" will be done and the script
will finish normally. Use to capture the internal printlog/buf prior to
the buffer being overwritten. Run a standard capture after Monitor Mode completes. (3ware Only)

MRWA = MegaRAID Work Around - Limits the MegaCli(64) commands that are run.
MegaCli has been seen to hang in some cases when running the 92xx controllers with
pre 4.1.1 FW and/or driver versions. Currently this switch bypasses the encinfo & adplilog
parameters. Instead of using this switch it is recommended to upgrade your code as this
work around is not always 100% effective. See the troubleshooting section for more information.

Trouble Shooting Script Issues -

I. Ubuntu 9.04
sudo ./lsigetlunix.sh -D -Q
Tue Sep 22 17:06:32 PDT 2009
export: 3: 22: bad variable name

Run;
sudo bash ./lsigetlunix.sh -D -Q

II. Script hangs with MegaRAID Controller

If you are positive the script is hung, CTRL-C the process, wait 3 minutes.
If the prompt doesn't come back kill the term window, do a ps -ea, note the
# of any lsigetlunix.sh or MegaCli(64) processes. Do a kill -9 process-number
for each process. If any can't be killed, wait 3 minutes, there is a 180 second
timeout on MegaCli. Upgrade your driver/fw/capture script to the latest version and
try again. If you cant upgrade or if you still have problems try the -MRWA switch.
If you still have problems manually zip the subdirectory structure and 
email it to your support rep.

III. Fails to run on Solaris - Error is ./lsigetlunix.sh: test: argument expected
Old version of Bourne shell is loaded by default, the following two shells were tried automatically
/bin/sh was changed to /usr/xpg4/bin/sh and then /bin/bash
depending on what is installed on the system, you can try others, i.e. csh/ksh or install a
supported shell...

Recommended Code Set/Release Versions

3ware-

This script should run with any release after 7.6.0 on the 7k, 8k
and 9k family of controllers.

MegaRAID -

This script should run with any release after 3.1 on the 82xx, 83xx, 84xx, 87xx,
88xx, 92xx and 93xx family of controllers.

HBA -

This script should run with any LSI HBA using an mpt based driver.

Capture Script Version: 022817

16:23:40.034362304
