Tuesday, August 21, 2007

Misc. SAN / FC Commands


Just a collection of commands I use in Solaris 10 to admin our SAN connections and disks:

fcinfo - display information about HBA and fibre channel targets conntected to the HBAs

bash-3.00# fcinfo hba-port
HBA Port WWN: 210000e08b89107e
OS Device Name: /dev/cfg/c0
Manufacturer: QLogic Corp.
Model: QLE2460
Firmware Version: 4.0.23
FCode/BIOS Version: QLE2460 Host Adapter Driver(SPARC): 1.11 10/03/05
Type: N-port
State: online
Supported Speeds: 1Gb 2Gb 4Gb
Current Speed: 4Gb
Node WWN: 200000e08b89107e



Sunday, August 05, 2007

Performance Collection Script for Solaris 10


I had the need to collect a bunch of system statistics on Solaris 10 servers during a performance test. I wanted to get these statistics at a much more frequent basis than I have sar configured for and I also wanted to include some scripts that I have found useful for collecting other performance statistics. So, I wrote a quick script to use during the test. One script that I plugged into mine is one written by Brendan Gregg. It’s called “nicstat” - it collects performance statistics for network interfaces. It can be downloaded from here. I am using the perl-based one.

To use:
1) Download the script from here.
1) Unzip the collect.tgz archive with gtar.
2) Put a copy of Brendan Gregg’s nicstat script into the collect subdirectory.
3) Run the collect.sh script.

Results:
When the script first starts up, it will create a subdirectory of the output directory named after the system you are on. After this, the script will loop, collecting various statistics during its execution and storing the results in the directory it created. Currently, the script will collect the following statistics:
netstat -an
nicstat
• A list of TCP sessions in the ESTABLISHED state
• A count of TCP sessions in the ESTABLISHED state (based on SRC and DEST IPs)
• A list of TCP sessions in the TIME_WAIT state
• A count of TCP sessions in the TIME_WAIT state (based on SRC and DEST IPs)
netstat -i
• TCP statistics from netstat -s
• I/O statistics from iostat -xnz
• Memory / CPU statistics from vmstat
• System event activity from vmstat -s

• Paging activity from vmstat -p
• Swap activity from vmstat -S


How to stop it:
The script will sleep for 5 minutes and then append to the end of the various files that it creates. To stop collection, simply press Ctrl-C. The snooze time between collections can be changed by modifying the SNOOZE parameter. It is currently configured to snooze 300 seconds (5 minutes).