Home

check_fc_config.sh




Purpose

 
check_fc_config.sh
is a kornshell script to view the fiber channel configuration in Solaris (x86 and SPARC sun4v machines).

check_fc_config.sh collects the output of the binaries cfgadm, prtdiag, prtconf, fcinfo, the contents of the file /etc/path_to_inst, and the contents of the directory /dev/cfg and generates a table of configured fiber channel adapter and LUNs using this information.

check_fc_config.sh can also be used to list the PCI slot usage of x86 or SPARC sun4v machines.

Please note that this script is still a development version.



Back to top

License


# CDDL HEADER START
#
# The contents of this file and the script are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License").  You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END


Back to top

History


Version
Releasedate
         Description
2.1.0
03.10.2014
####   03.10.2014 v2.1.0 /bs
####     the script now also prints the PCI Slot usage for SPARC Tx machines
####     added the parameter -P (show PCI slot usage only)

2.0.1
17.09.2014
####   17.09.2014 v2.0.1 /bs
####     PCI Slot information in the output file for -L for x86 machines was still wrong -- corrected

2.0.0
04.09.2014
####   03.09.2014 v2.0.0 /bs
####     script rewritten using the template scriptt.sh v2.0.0.7
####     changed the code for x86 machines some how
####     added some debug switches (use -D help to list the known debug switches)

1.2.2
05.12.2013
initial public release



Back to top

Operating system

Solaris 10 or newer


Back to top

Language / type

Kornshell Script


Back to top

Prerequisites

Solaris 10 x86 or Solaris 10 SPARC; supported machine types are x86 and SPARC sun4v.




Back to top

Usage


[xtrnaw7@t540p scripts]$ ./check_fc_config.sh -v -h
[03.10.2014 14:07:07] check_fc_config.sh v2.0.1 started at Fr 3. Okt 14:07:07 CEST 2014.
[03.10.2014 14:07:07] No config file ("check_fc_config.conf") found (use -C to create a default config file)
  check_fc_config.sh v2.0.1 - check the fiber channel configuration in Solaris

  Usage: check_fc_config.sh [-v|+v] [-q|+q] [-h] [-l logfile|+l] [-y|+y] [-n|+n]
                    [-D debugswitch] [-a|+a] [-O|+O] [-f|+f] [-C] [-H] [-X] [-S n] [-V] [-T]

                    -L outputfile [-s|+s] [-P|+P]

  Use the parameter "-v -h [-v]" to view the detailed online help; use the parameter "-X" to view some usage examples.

  see also http://bnsmb.de/solaris/scriptt.html




 Note: Use -{switch} or --{longswitch} to turn an option on;
       use +{switch} or ++{longswitch} to turn an option off

       The long format of the parameter (--parameter/++parameter) is not supported by all ksh implementations


    Parameter:

      -v|+v - turn verbose mode on/off; current value: y
              Long format: --verbose / ++verbose
      -q|+q - turn quiet mode on/off; current value: n
              Long format: --quiet / ++quiet
      -h    - show usage
              Long format: --help
      -l    - set the logfile
              current value: /var/tmp/check_fc_config.LOG
              Long format: --logfile
      +l    - do not write a logfile
              Long format: ++logfile
      -y|+y - assume yes to all questions or not
              Long format: --yes / ++yes
      -n|+n - assume no to all questions or not
              Long format: --no /++no
      -D|+D - debug switch
              current value:
              use "-D help" to list the known debug switches
              Long format: --debug / ++debug
      -a|+a - turn colors on/off; current value: n
              Long format: --color / ++color
      -O|+O - overwrite existing files or not; current value: n
              Long format: --overwrite / ++overwrite
      -f|+f - force; do it anyway; current value: n
              Long format: --force / ++force
      -C    - write a default config file in the current directory and exit
              Long format: --writeconfigfile
      -H    - write extended usage to STDERR and exit
              Long format: --doc
      -X    - write usage examples to STDERR and exit
              Long format: --view_examples
      -S n  - print error/warning summaries:
              n = 0 no summariess, 1 = print error msgs,
              2 = print warning msgs, 3 = print error and warning mgs
              Current value: 0
              Long format: --summaries
      -V    - write version number to STDOUT and exit
              Long format: --version
      -T    - append STDOUT and STDERR to the file "/var/tmp/check_fc_config.sh.22735.tee.log"
              Long format: --tee

      -P    - only list all slots found; only supported for x86 and sun4v SPARC machines
              current value: n
              Long format: --list_slots_only

      -s    - list all slots found; only supported for x86 and sun4v SPARC machines
              current value: n
              Long format: --list_all_slots

      -L outputfile
            - write the zoning for SAN devices to the file outputfile
              current value:
              Long format: --logZoning

Legend:

PCI S/P          - PCI Slot / Port (sparc: prtdiag, x86: prtconf)
Device Path      - Solaris Device Path (/etc/path_to_inst)
Ctlr             - Solaris controller number (/dev/cfg/*)
State:           - state of the port (fcinfo)
Port WWN:        - port wwn (fcinfo)
Name:            - Solaris device name (/etc/path_to_inst)
# LUNs           - number of LUNs visible/uniq numer of LUNs visible (fcinfo)
# Disks          - number of disks visible (cfgadm)
# Tapes          - number of tapes visible (cfgadm)
# fabrics        - number of fabrics visible (cfgadm)
# misc           - number of devices visible that are neither tape nor disk (cfgadm)
SAN dev/w errors - SAN devices with errors (cfgadm)

[03.10.2014 14:07:07] The log file used was "/tmp/check_fc_config.sh.22735.TEMP" 
[03.10.2014 14:07:07] check_fc_config.sh v2.0.1 started at Fr 3. Okt 14:07:07 CEST 2014 and ended at Fr 3. Okt 14:07:07 CEST 2014.
[03.10.2014 14:07:07] The time used for the script is 0 minutes and 0 seconds.
[03.10.2014 14:07:07] The RC is 1.
[xtrnaw7@t540p scripts]$
 

Known debug switches are:

[xtrnaw7@t540p scripts]$ ./check_fc_config.sh -D help
[03.10.2014 14:16:00] check_fc_config.sh v2.0.1 started at Fr 3. Okt 14:16:00 CEST 2014.
[03.10.2014 14:16:00] No config file ("check_fc_config.conf") found (use -C to create a default config file)
Known debug switches (for -d / --debug):

  help          -- show this usage and exit
  msg           -- log debug messages to the file /tmp/check_fc_config.sh.23047.debug
  trace         -- activate tracing to the file /tmp/check_fc_config.sh.23047.trace
  fn_to_stderr  -- print the function names to STDERR
  fn_to_tty     -- print the function names to /dev/tty
  fn_to_handle9 -- print the function names ot the file handle 9

  save_os_config=file
                -- save the OS config files that can be used as input files
                   for this script in the tar file "file" and exit
  alternate_slot_names=[yes|no]
                -- use alternate slot name syntax, try this switch if
                   the PCI slot usage shown by this script is not
                   correct
  print_slot_list
                -- print the list of slots found (x86 only)
  prtdiag=file  -- file with the output of "prtdiag -v" (used for sparc only)
  fcinfo=file   -- file with the output of "fcinfo hba-port"
  prtconf=file  -- file with the output of "prtconf -vpPD" (used for x86 only)
  path_to_inst=file
                -- copy of the file /etc/path_to_inst
[03.10.2014 14:16:00] The log file used was "/tmp/check_fc_config.sh.23047.TEMP" 
[03.10.2014 14:16:00] check_fc_config.sh v2.0.1 started at Fr 3. Okt 14:16:00 CEST 2014 and ended at Fr 3. Okt 14:16:00 CEST 2014.
[03.10.2014 14:16:00] The time used for the script is 0 minutes and 0 seconds.
[03.10.2014 14:16:00] The RC is 0.




Back to top

Examples


Notes:

The numbers in the colum "# LUNs" mean: 

The first number is the number of LUNs seen via this port; the second number is the number of uniqe LUNs seen via this port.

e.g 418/209 : There are 418 LUNs visible in total via this port but only 209 uniqe LUNs.


# Sample output from an x86 machine with the list of pci adapter found (parameter -s)
#
[
04.09.2014 20:06:19] check_fc_config.sh v2.0.0 started at Thu Sep  4 20:06:19 CEST 2014.
[04.09.2014 20:06:19] No config file ("check_fc_config.conf") found (use -C to create a default config file)
[04.09.2014 20:06:19] Using the log file "/var/tmp/check_fc_config.LOG" 
 
[04.09.2014 20:06:19] Retrieving the infos from "prtconf" ...
[04.09.2014 20:06:19] Retrieving the infos from "fcinfo hba-port" ...
[04.09.2014 20:06:19] Retrieving the infos from "cfgadm -la" ...
[04.09.2014 20:06:21] Retrieving the infos from "cfgadm -la -o show_FCP_dev" ...
[04.09.2014 20:06:21] Retrieving the infos from /dev/cfg/c* and /etc/path_to_inst ...
[04.09.2014 20:06:21] Retrieving the infos from "fcinfo remote-port -p 21000024ff0aad74 -s" ...
[04.09.2014 20:06:21] Retrieving the infos from "fcinfo remote-port -p 21000024ff0ad0c2 -s" ...
 
[04.09.2014 20:06:21] 2 adapter port(s) found; 2 port(s) are online, 0 port(s) are offline.
 
PCI S/P        Device Path                                Ctlr State     Port WWN                Name  # LUNs     # Disks # Tapes # fabrics # misc  SAN dev w/ errors
PCI 2/0        /pci@0,0/pci8086,3c0a@3,2/pci1077,15c@0    c2   online    21:00:00:24:ff:0a:ad:74 qlc1  0/0        0       0       1         0       
PCI 1/0        /pci@0,0/pci8086,3c08@3/pci1077,15c@0      c1   online    21:00:00:24:ff:0a:d0:c2 qlc0  0/0        0       0       1         0       
 
[04.09.2014 20:06:21] x86 Slot Usage

  Slot No.                           Adapter class                             Device path                                                 Device name
         0                     Ethernet controller               pci8086,1d10/pci8086,1521                                         igb0 igb1 igb2 igb3
         0               VGA compatible controller                      pci1912,12/display                                                    vgatext0
         1                           Fibre Channel                pci8086,3c08/pci1077,15c                                                        qlc0
         2                           Fibre Channel                pci8086,3c0a/pci1077,15c                                                        qlc1
         3                         RAID controller                pci8086,3c06/pci1014,412                                                     mr_sas0
         6                     Ethernet controller               pci8086,3c08/pci8086,12a2                                         igb4 igb5 igb6 igb7
 
 
[04.09.2014 20:06:21] The log file used was "/var/tmp/check_fc_config.LOG" 
[04.09.2014 20:06:21] check_fc_config.sh v2.0.0 started at Thu Sep  4 20:06:19 CEST 2014 and ended at Thu Sep  4 20:06:21 CEST 2014.
[04.09.2014 20:06:21] The time used for the script is 0 minutes and 2 seconds.
[04.09.2014 20:06:21] The RC is 0. 




# Sample output from an x86 machine with SAN disks only

[02.12.2013 07:25:56] check_fc_config.sh v1.2.2 started on Mon Dec  2 07:25:56 CET 2013 
[02.12.2013 07:25:56] No config file ("check_fc_config.conf") found (use -C to create a default config file)
[02.12.2013 07:25:56] Using the log file "/var/tmp/check_fc_config.LOG" 
 
[02.12.2013 07:25:56] Retrieving the infos from "prtconf" ...
[02.12.2013 07:25:56] Retrieving the infos from "fcinfo hba-port" ...
[02.12.2013 07:25:56] Retrieving the infos from "cfgadm -la" ...
[02.12.2013 07:25:57] Retrieving the infos from "cfgadm -la -o show_FCP_dev" ...
[02.12.2013 07:25:58] Retrieving the infos from /dev/cfg/c* and /etc/path_to_inst ...
[02.12.2013 07:25:58] Retrieving the infos from "fcinfo remote-port -p 21000025ff46fd30 -s" ...
[02.12.2013 07:25:58] Retrieving the infos from "fcinfo remote-port -p 21000025ff46fd31 -s" ...
[02.12.2013 07:25:58] Retrieving the infos from "fcinfo remote-port -p 21000025ff47140a -s" ...
[02.12.2013 07:25:58] Retrieving the infos from "fcinfo remote-port -p 21000025ff47140b -s" ...
 
[02.12.2013 07:25:58] 4 adapter port(s) found; 2 port(s) are online, 2 port(s) are offline.
 
PCI S/P   Device Path                                Ctlr State     Port WWN                Name  # LUNs     # Disks # Tapes # fabrics # misc  SAN dev w/ errors
PCI 1/0   /pci@0,0/pci8086,340c@5/pci1077,15d@0      c4   online    21:00:00:25:ff:46:f0:30 qlc2  418/209    418     0       1         0       
PCI 1/1   /pci@0,0/pci8086,340c@5/pci1077,15d@0,1    c5   offline   21:00:00:25:ff:46:f0:31 qlc3  0/0        0       0       0         0       
PCI 2/0   /pci@0,0/pci8086,340a@3/pci1077,15d@0      c2   online    21:00:00:25:ff:47:a2:0a qlc0  418/209    418     0       1         0       
PCI 2/1   /pci@0,0/pci8086,340a@3/pci1077,15d@0,1    c3   offline   21:00:00:25:ff:47:a2:0b qlc1  0/0        0       0       0         0       
 
[02.12.2013 07:25:58] The log file used was "/var/tmp/check_fc_config.LOG" 
[02.12.2013 07:25:58] check_fc_config.sh v1.2.2 ended on Mon Dec  2 07:25:58 CET 2013.
[02.12.2013 07:25:58] The RC is 0.


# Sample output from a SPARC machine with SAN disks and tapes

# check_fc_config.sh
[02.12.2013 07:27:08] check_fc_config.sh v1.2.2 started on Mon Dec  2 07:27:08 CET 2013 
[02.12.2013 07:27:08] No config file ("check_fc_config.conf") found (use -C to create a default config file)
[02.12.2013 07:27:08] Using the log file "/var/tmp/check_fc_config.LOG" 
 
[02.12.2013 07:27:08] Retrieving the infos from "fcinfo hba-port" ...
[02.12.2013 07:27:08] Retrieving the infos from "cfgadm -la" ...
[02.12.2013 07:27:15] Retrieving the infos from "cfgadm -la -o show_FCP_dev" ...
[02.12.2013 07:27:20] Retrieving the infos from /dev/cfg/c* and /etc/path_to_inst ...
[02.12.2013 07:27:22] Retrieving the infos from "fcinfo remote-port -p 21000042ee1f2760 -s" ...
[02.12.2013 07:27:23] Retrieving the infos from "fcinfo remote-port -p 21000042ee1f2761 -s" ...
[02.12.2013 07:27:23] Retrieving the infos from "fcinfo remote-port -p 21000046ff46d15c -s" ...
[02.12.2013 07:27:24] Retrieving the infos from "fcinfo remote-port -p 21000046ff46d15d -s" ...
[02.12.2013 07:27:24] Retrieving the infos from "fcinfo remote-port -p 21000042ee1f27e4 -s" ...
[02.12.2013 07:27:24] Retrieving the infos from "fcinfo remote-port -p 21000042ee1f27e5 -s" ...
[02.12.2013 07:27:24] Retrieving the infos from "fcinfo remote-port -p 21000042ee1f27dc -s" ...
[02.12.2013 07:27:24] Retrieving the infos from "fcinfo remote-port -p 21000042ee1f27dd -s" ...
[02.12.2013 07:27:24] Retrieving the infos from "prtdiag -v" ...
 
[02.12.2013 07:27:40] 8 adapter port(s) found; 6 port(s) are online, 2 port(s) are offline.
 
PCI S/P   Device Path                                Ctlr State     Port WWN                Name  # LUNs     # Disks # Tapes # fabrics # misc  SAN dev w/ errors
PCIE0/0   /pci@400/pci@2/pci@0/pci@8/SUNW,qlc@0      c5   online    21:00:00:42:ee:1f:27:60 qlc2  1200/600   1200    0       1         0       
PCIE0/1   /pci@400/pci@2/pci@0/pci@8/SUNW,qlc@0,1    c6   online    21:00:00:42:ee:1f:27:61 qlc3  0/0        0       0       1         0       
PCIE5/0   /pci@500/pci@2/pci@0/pci@0/SUNW,qlc@0      c13  online    21:00:00:46:ff:46:d1:5c qlc6  1200/600   1200    0       1         0       
PCIE5/1   /pci@500/pci@2/pci@0/pci@0/SUNW,qlc@0,1    c14  online    21:00:00:46:ff:46:d1:5d qlc7  0/0        0       0       1         0       
PCIE2/0   /pci@400/pci@2/pci@0/pci@4/SUNW,qlc@0      c3   offline   21:00:00:42:ee:1f:27:e4 qlc0  0/0        0       0       0         0       
PCIE2/1   /pci@400/pci@2/pci@0/pci@4/SUNW,qlc@0,1    c4   online    21:00:00:42:ee:1f:27:e5 qlc1  30/30      0       30      1         0       
PCIE7/0   /pci@500/pci@1/pci@0/pci@6/SUNW,qlc@0      c11  offline   21:00:00:42:ee:1f:27:dc qlc4  0/0        0       0       0         0       
PCIE7/1   /pci@500/pci@1/pci@0/pci@6/SUNW,qlc@0,1    c12  online    21:00:00:42:ee:1f:27:dd qlc5  30/30      0       30      1         0       
 
[02.12.2013 07:27:40] All PCI Slots are assigend to the Primary LDom.
 
[02.12.2013 07:27:40] The log file used was "/var/tmp/check_fc_config.LOG" 
[02.12.2013 07:27:40] check_fc_config.sh v1.2.2 ended on Mon Dec  2 07:27:40 CET 2013.
[02.12.2013 07:27:40] The RC is 0.


# Sample output from a SPARC machine with LUNS and zoning errors


# check_fc_config.sh
02.12.2013 07:28:31] check_fc_config.sh v1.2.2 started on Mon Dec  2 07:28:31 CET 2013 
[02.12.2013 07:28:31] No config file ("check_fc_config.conf") found (use -C to create a default config file)
[02.12.2013 07:28:31] Using the log file "/var/tmp/check_fc_config.LOG" 
 
[02.12.2013 07:28:31] Retrieving the infos from "fcinfo hba-port" ...
[02.12.2013 07:28:31] Retrieving the infos from "cfgadm -la" ...
[02.12.2013 07:28:37] Retrieving the infos from "cfgadm -la -o show_FCP_dev" ...
[02.12.2013 07:28:45] Retrieving the infos from /dev/cfg/c* and /etc/path_to_inst ...
[02.12.2013 07:28:46] Retrieving the infos from "fcinfo remote-port -p 21000024ee2854d0 -s" ...
[02.12.2013 07:28:46] Retrieving the infos from "fcinfo remote-port -p 21000024ee2854d1 -s" ...
[02.12.2013 07:28:46] Retrieving the infos from "fcinfo remote-port -p 21000024ee46ce5e -s" ...
[02.12.2013 07:28:46] Retrieving the infos from "fcinfo remote-port -p 21000024ee46ce5f -s" ...
[02.12.2013 07:28:47] Retrieving the infos from "prtdiag -v" ...
 
[02.12.2013 07:28:48] 4 adapter port(s) found; 4 port(s) are online, 0 port(s) are offline.
 
PCI S/P   Device Path                                Ctlr State     Port WWN                Name  # LUNs     # Disks # Tapes # fabrics # misc  SAN dev w/ errors
PCIe16/0  /pci@10,600000/pci@0/pci@9/SUNW,qlc@0      c4   online    21:00:00:24:ee:28:54:d0 qlc2  562/281    1144    0       1         0       c4::500507680130dc87
PCIe16/1  /pci@10,600000/pci@0/pci@9/SUNW,qlc@0,1    c5   online    21:00:00:24:ee:28:54:d1 qlc3  0/0        0       0       1         0       
PCIe0/0   /pci@0,600000/pci@0/pci@9/SUNW,qlc@0       c2   online    21:00:00:24:ee:46:ce:5e qlc0  562/281    1144    0       1         0       c2::500507680140dc87
PCIe0/1   /pci@0,600000/pci@0/pci@9/SUNW,qlc@0,1     c3   online    21:00:00:24:ee:46:ce:5f qlc1  0/0        0       0       1         0       
 
[02.12.2013 07:28:48] The log file used was "/var/tmp/check_fc_config.LOG" 
[02.12.2013 07:28:48] check_fc_config.sh v1.2.2 ended on Mon Dec  2 07:28:48 CET 2013.
[02.12.2013 07:28:48] The RC is 0.



# Using the parameter -L {outputfile} check_fc_config.sh writes a table with LUNs and fiber channel adapter ports:

# check_fc_config.sh -L ./luns.lst
[03.12.2013 06:55:54] check_fc_config.sh v1.2.2 started on Tue Dec  3 06:55:54 CET 2013 
[03.12.2013 06:55:54] No config file ("check_fc_config.conf") found (use -C to create a default config file)
[03.12.2013 06:55:54] Using the log file "/var/tmp/check_fc_config.LOG" 
 
[03.12.2013 06:55:54] Retrieving the infos from "fcinfo hba-port" ...
[03.12.2013 06:55:54] Retrieving the infos from "cfgadm -la" ...
[03.12.2013 06:56:02] Retrieving the infos from "cfgadm -la -o show_FCP_dev" ...
[03.12.2013 06:56:07] Retrieving the infos from /dev/cfg/c* and /etc/path_to_inst ...
[03.12.2013 06:56:09] Retrieving the infos from "fcinfo remote-port -p 21000022ee1f2760 -s" ...
[03.12.2013 06:56:10] Retrieving the infos from "fcinfo remote-port -p 21000022ee1f2761 -s" ...
[03.12.2013 06:56:10] Retrieving the infos from "fcinfo remote-port -p 21000024ff33d15c -s" ...
[03.12.2013 06:56:11] Retrieving the infos from "fcinfo remote-port -p 21000024ff33d15d -s" ...
[03.12.2013 06:56:11] Retrieving the infos from "fcinfo remote-port -p 21000022ee1f27e4 -s" ...
[03.12.2013 06:56:11] Retrieving the infos from "fcinfo remote-port -p 21000022ee1f27e5 -s" ...
[03.12.2013 06:56:11] Retrieving the infos from "fcinfo remote-port -p 21000022ee1f27dc -s" ...
[03.12.2013 06:56:11] Retrieving the infos from "fcinfo remote-port -p 21000022ee1f27dd -s" ...
[03.12.2013 06:56:11] Retrieving the infos from "prtdiag -v" ...
 
[03.12.2013 06:56:28] 8 adapter port(s) found; 6 port(s) are online, 2 port(s) are offline.
 
PCI S/P   Device Path                                Ctlr State     Port WWN                Name  # LUNs     # Disks # Tapes # fabrics # misc  SAN dev w/ errors
PCIE0/0   /pci@400/pci@2/pci@0/pci@8/SUNW,qlc@0      c5   online    21:00:00:22:ee:1f:27:60 qlc2  1200/600   1200    0       1         0       
PCIE0/1   /pci@400/pci@2/pci@0/pci@8/SUNW,qlc@0,1    c6   online    21:00:00:22:ee:1f:27:61 qlc3  0/0        0       0       1         0       
PCIE5/0   /pci@500/pci@2/pci@0/pci@0/SUNW,qlc@0      c13  online    21:00:00:24:ff:33:d1:5c qlc6  1200/600   1200    0       1         0       
PCIE5/1   /pci@500/pci@2/pci@0/pci@0/SUNW,qlc@0,1    c14  online    21:00:00:24:ff:33:d1:5d qlc7  0/0        0       0       1         0       
PCIE2/0   /pci@400/pci@2/pci@0/pci@4/SUNW,qlc@0      c3   offline   21:00:00:22:ee:1f:27:e4 qlc0  0/0        0       0       0         0       
PCIE2/1   /pci@400/pci@2/pci@0/pci@4/SUNW,qlc@0,1    c4   online    21:00:00:22:ee:1f:27:e5 qlc1  30/30      0       30      1         0       
PCIE7/0   /pci@500/pci@1/pci@0/pci@6/SUNW,qlc@0      c11  offline   21:00:00:22:ee:1f:27:dc qlc4  0/0        0       0       0         0       
PCIE7/1   /pci@500/pci@1/pci@0/pci@6/SUNW,qlc@0,1    c12  online    21:00:00:22:ee:1f:27:dd qlc5  30/30      0       30      1         0       
 
[03.12.2013 06:56:29] Writing the zoning for each SAN device to the file "/root/./luns.lst" ...
 
[03.12.2013 06:57:09] All PCI Slots are assigend to the Primary LDom.
 
[03.12.2013 06:57:09] The log file used was "/var/tmp/check_fc_config.LOG" 
[03.12.2013 06:57:09] check_fc_config.sh v1.2.2 ended on Tue Dec  3 06:57:09 CET 2013.
[03.12.2013 06:57:09] The RC is 0.


# The output file written with -L looks like:
#
# (The number in the columns with the Solaris device names are the number of pathes for this LUN via this Solaris device)

# more luns.lst

SAN Device                         Type      PCIE0/0   PCIE0/1   PCIE5/0   PCIE5/1   PCIE2/0   PCIE2/1   PCIE7/0   PCIE7/1  
---                                ---       qlc2      qlc3      qlc6      qlc7      qlc0      qlc1      qlc4      qlc5     

6004083457804566600000000000001D   disk      2         0         2         0         0         0         0         0        
60040834578045666000000000000024   disk      2         0         2         0         0         0         0         0        
60040834578045666000000000000026   disk      2         0         2         0         0         0         0         0        
60040834578045666000000000000027   disk      2         0         2         0         0         0         0         0        
60040834578045666000000000000028   disk      2         0         2         0         0         0         0         0        
60040834578045666000000000000029   disk      2         0         2         0         0         0         0         0        
6004083457804566600000000000002C   disk      2         0         2         0         0         0         0         0        
6004083457804566600000000000002D   disk      2         0         2         0         0         0         0         0        
6004083457804566600000000000002E   disk      2         0         2         0         0         0         0         0        
60040834578045666000000000000031   disk      2         0         2         0         0         0         0         0        
...


# Using the parameter -s check_fc_config.sh lists also the PCI slot usage


# /var/tmp/check_fc_config.sh -s
[03.10.2014 13:33:43] check_fc_config.sh v2.0.1 started at Fri Oct  3 13:33:43 CEST 2014.
[03.10.2014 13:33:43] No config file ("check_fc_config.conf") found (use -C to create a default config file)
[03.10.2014 13:33:43] Using the log file "/var/tmp/check_fc_config.LOG" 
 
[03.10.2014 13:34:00] Retrieving the infos from "fcinfo hba-port" ...
[03.10.2014 13:34:00] Retrieving the infos from "cfgadm -la" ...
[03.10.2014 13:34:20] Retrieving the infos from "cfgadm -la -o show_FCP_dev" ...
[03.10.2014 13:34:29] Retrieving the infos from /dev/cfg/c* and /etc/path_to_inst ...
[03.10.2014 13:34:32] Retrieving the infos from "fcinfo remote-port -p 21000024ff4d40d0 -s" ...
[03.10.2014 13:34:33] Retrieving the infos from "fcinfo remote-port -p 21000024ff4d40d1 -s" ...
[03.10.2014 13:34:33] Retrieving the infos from "fcinfo remote-port -p 21000024ff4d4066 -s" ...
[03.10.2014 13:34:33] Retrieving the infos from "fcinfo remote-port -p 21000024ff4d4067 -s" ...
[03.10.2014 13:34:34] Retrieving the infos from "fcinfo remote-port -p 21000024ff4d41ca -s" ...
[03.10.2014 13:34:35] Retrieving the infos from "fcinfo remote-port -p 21000024ff4d41cb -s" ...
[03.10.2014 13:34:35] Retrieving the infos from "fcinfo remote-port -p 21000024ff4d409e -s" ...
[03.10.2014 13:34:35] Retrieving the infos from "fcinfo remote-port -p 21000024ff4d409f -s" ...
[03.10.2014 13:34:35] Retrieving the infos from "prtdiag -v" ...
 
[03.10.2014 13:34:50] 8 adapter port(s) found; 6 port(s) are online, 2 port(s) are offline.
 
PCI S/P        Device Path                                Ctlr State     Port WWN                Name  # LUNs     # Disks # Tapes # fabrics # misc  SAN dev w/ errors
PCIE0/0        /pci@400/pci@2/pci@0/pci@8/SUNW,qlc@0      c5   online    21:00:00:24:ff:4d:40:d0 qlc2  1650/1650  1650    0       1         0       
PCIE0/1        /pci@400/pci@2/pci@0/pci@8/SUNW,qlc@0,1    c6   online    21:00:00:24:ff:4d:40:d1 qlc3  30/30      0       30      1         0       
PCIE2/0        /pci@400/pci@2/pci@0/pci@4/SUNW,qlc@0      c3   online    21:00:00:24:ff:4d:40:66 qlc0  30/30      0       30      1         0       
PCIE2/1        /pci@400/pci@2/pci@0/pci@4/SUNW,qlc@0,1    c4   online    21:00:00:24:ff:4d:40:67 qlc1  30/30      0       30      1         0       
PCIE5/0        /pci@500/pci@2/pci@0/pci@0/SUNW,qlc@0      c13  online    21:00:00:24:ff:4d:41:ca qlc6  1650/1650  1650    0       1         0       
PCIE5/1        /pci@500/pci@2/pci@0/pci@0/SUNW,qlc@0,1    c14  online    21:00:00:24:ff:4d:41:cb qlc7  30/30      0       30      1         0       
PCIE7/0        /pci@500/pci@1/pci@0/pci@6/SUNW,qlc@0      c11  offline   21:00:00:24:ff:4d:40:9e qlc4  0/0        0       0       0         0       
PCIE7/1        /pci@500/pci@1/pci@0/pci@6/SUNW,qlc@0,1    c12  offline   21:00:00:24:ff:4d:40:9f qlc5  0/0        0       0       0         0       
 
[03.10.2014 13:34:50] All PCI Slots are assigned to the Primary LDom.
 
[03.10.2014 13:34:50] SPARC Slot Usage

  Slot No.                           Adapter model                                                 Device path                             Device name
      NET0                                internal                        /pci@400/pci@1/pci@0/pci@4/network@0                                    igb0
      NET1                                internal                      /pci@400/pci@1/pci@0/pci@4/network@0,1                                    igb1
      NET2                                internal                        /pci@500/pci@1/pci@0/pci@5/network@0                                    igb2
      NET3                                internal                      /pci@500/pci@1/pci@0/pci@5/network@0,1                                    igb3
     PCIE0                                 QLE2562                       /pci@400/pci@2/pci@0/pci@8/SUNW,qlc@0                               qlc2 qlc3
     PCIE1                           SUNW,pcie-qgc                        /pci@500/pci@2/pci@0/pci@a/network@0             nxge12 nxge13 nxge14 nxge15
     PCIE2                                 QLE2562                       /pci@400/pci@2/pci@0/pci@4/SUNW,qlc@0                               qlc0 qlc1
     PCIE3                           SUNW,pcie-qgc                        /pci@500/pci@2/pci@0/pci@6/network@0               nxge8 nxge9 nxge10 nxge11
     PCIE4                           SUNW,pcie-qgc                        /pci@400/pci@2/pci@0/pci@0/network@0                 nxge4 nxge5 nxge6 nxge7
     PCIE5                                 QLE2562                       /pci@500/pci@2/pci@0/pci@0/SUNW,qlc@0                               qlc6 qlc7
     PCIE6                           SUNW,pcie-qgc                        /pci@400/pci@1/pci@0/pci@8/network@0                 nxge0 nxge1 nxge2 nxge3
     PCIE7                                 QLE2562                       /pci@500/pci@1/pci@0/pci@6/SUNW,qlc@0                               qlc4 qlc5
     VIDEO                                internal                  /pci@400/pci@1/pci@0/pci@0/pci@0/display@0                                    ast0
    SASHBA                                LSI,2008                           /pci@400/pci@2/pci@0/pci@e/scsi@0                                mpt_sas0
   USBPCIX                                internal                      /pci@400/pci@1/pci@0/pci@b/pci@0/usb@0                       ohci0 ohci1 ehci0
 
 
[03.10.2014 13:34:50] The log file used was "/var/tmp/check_fc_config.LOG" 
[03.10.2014 13:34:50] check_fc_config.sh v2.0.1 started at Fri Oct  3 13:33:43 CEST 2014 and ended at Fri Oct  3 13:34:50 CEST 2014.
[03.10.2014 13:34:50] The time used for the script is 1 minutes and 8 seconds.
[03.10.2014 13:34:50] The RC is 0.
 

Use the parameter -P to only list the PCI slot usage:

# /var/tmp/check_fc_config.sh -P
[03.10.2014 14:18:11] check_fc_config.sh v2.0.1 started at Fri Oct  3 14:18:11 CEST 2014.
[03.10.2014 14:18:11] No config file ("check_fc_config.conf") found (use -C to create a default config file)
[03.10.2014 14:18:11] Using the log file "/var/tmp/check_fc_config.LOG" 
 
[03.10.2014 14:18:11] Retrieving the infos from "prtconf" ...
[03.10.2014 14:18:11] x86 Slot Usage

  Slot No.                           Adapter class                             Device path                                                 Device name
         1                           Fibre Channel                pci8086,340c/pci1077,15d                                                   qlc0 qlc1
         2                           Fibre Channel                pci8086,340a/pci1077,15d                                                   qlc4 qlc5
         3                     Ethernet controller               pci8086,3410/pci14e4,1907                                                   bnx6 bnx7
         4                     Ethernet controller               pci8086,340e/pci14e4,1907                                                   bnx4 bnx5
         5                         RAID controller                pci8086,3a40/pci1014,3b2                                                     mr_sas0
 
 
[03.10.2014 14:18:11] The log file used was "/var/tmp/check_fc_config.LOG" 
[03.10.2014 14:18:11] check_fc_config.sh v2.0.1 started at Fri Oct  3 14:18:11 CEST 2014 and ended at Fri Oct  3 14:18:11 CEST 2014.
[03.10.2014 14:18:11] The time used for the script is 0 minutes and 0 seconds.
[03.10.2014 14:18:11] The RC is 0.



# /var/tmp/check_fc_config.sh -P
[03.10.2014 14:21:31] check_fc_config.sh v2.0.1 started at Fri Oct  3 14:21:31 CEST 2014.
[03.10.2014 14:21:31] No config file ("check_fc_config.conf") found (use -C to create a default config file)
[03.10.2014 14:21:31] Using the log file "/var/tmp/check_fc_config.LOG" 
 
[03.10.2014 14:21:31] Retrieving the infos from "prtdiag" ...
[03.10.2014 14:21:31] Retrieving the infos from "prtdiag -v" ...
[03.10.2014 14:21:31] Retrieving the infos from "cat /etc/path_to_inst" ...
[03.10.2014 14:21:31] SPARC Slot Usage

  Slot No.                           Adapter model                                                 Device path                             Device name
        MB                                internal                     /pci@8000/pci@4/pci@0/pci@2/pci@0/usb@4                             ohci0 ehci0
      NET0                                internal                       /pci@8000/pci@4/pci@0/pci@1/network@0                                    igb0
      NET1                                internal                     /pci@8000/pci@4/pci@0/pci@1/network@0,1                                    igb1
      NET2                                internal                       /pci@8100/pci@4/pci@0/pci@0/network@0                                    igb2
      NET3                                internal                     /pci@8100/pci@4/pci@0/pci@0/network@0,1                                    igb3
      PCI0                                 QLE2562                      /pci@8000/pci@4/pci@0/pci@8/SUNW,qlc@0                               qlc0 qlc1
      PCI1                           SUNW,pcie-igb                       /pci@8100/pci@4/pci@0/pci@1/network@0                     igb4 igb5 igb6 igb7
      PCI2                                 QLE2562                      /pci@8100/pci@4/pci@0/pci@9/SUNW,qlc@0                               qlc2 qlc3
    SASHBA                              LSI,2308_2                          /pci@8000/pci@4/pci@0/pci@0/scsi@0                                mpt_sas0
 
 
[03.10.2014 14:21:31] The log file used was "/var/tmp/check_fc_config.LOG" 
[03.10.2014 14:21:31] check_fc_config.sh v2.0.1 started at Fri Oct  3 14:21:31 CEST 2014 and ended at Fri Oct  3 14:21:31 CEST 2014.
[03.10.2014 14:21:31] The time used for the script is 0 minutes and 0 seconds.
[03.10.2014 14:21:31] The RC is 0.





Back to top

Internas


see the documentation for the script template used for this script: scriptt.sh


Back to top

Notes



Back to top

Download


Download check_fc_config.sh



Back to top