vhci_stat

My simple MPxIO path status program can be downloaded here.

Actual version is 1.3.1.

Binaries for SPARC and x86 are included.

To build, you have to have a compiler (gcc is fine) and the SUN header files (SUNWhea).

Just type make:

# gzip -dc vhci_stat-1.3.1.tar.gz | tar xf -
# cd vhci_stat-1.3.1
# make
gcc -DZFS -o vhci_stat vhci_stat.c -ldevinfo -lzfs -lnvpair
#

If you want to use cc instead of gcc, just change the "CC=gcc" line in the Makefile.

Sample usage with option -i (query vendor and product ids), and with -z (get ZFS data) here from a x86 machine (you will notice that the devices have a name "disk@", as SAN disks are handled by the solaris sd driver here):

# vhci_stat -iz
vhci_stat
1.3.1; Pascal Gienger <pascal@southbrain.com>; http://southbrain.com/south/
Host: atlanta

PATH                                              WWPN,LUN            STATE
------------------------------------------------- ------------------- -----
/scsi_vhci/disk@g600d0230006b66680c50ab4f92f61000
  (Vendor = ADVUNI   Model = OXYGENRAID 416F4 Rev. = 347B VolID = 4F92F610)
   ZFS: pool name = atl1, ZFS Version: 4
   ZFS: size = 698.37G, member type = mirror
    /pci@7b,0/pci10de,5d@d/pci1077,142@0/fp@0,0   210000d0231c50ab,1  ONLINE
    /pci@7b,0/pci10de,5d@e/pci1077,142@0/fp@0,0   220000d0232c50ab,1  ONLINE
/scsi_vhci/disk@g600d0230006b66680c50ab5675f91300
  (Vendor = ADVUNI   Model = OXYGENRAID 416F4 Rev. = 347B VolID = 5675F913)
   ZFS: pool name = atl2, ZFS Version: 4
   ZFS: size = 3.41T, member type = mirror
    /pci@7b,0/pci10de,5d@d/pci1077,142@0/fp@0,0   210000d0231c50ab,2  ONLINE
    /pci@7b,0/pci10de,5d@e/pci1077,142@0/fp@0,0   220000d0232c50ab,2  ONLINE
/scsi_vhci/disk@g600d0230006b66680c50ab0f36adf100
  (Vendor = ADVUNI   Model = OXYGENRAID 416F4 Rev. = 347B VolID = 0F36ADF1)
   ZFS: pool name = atl2, ZFS Version: 4
   ZFS: size = 3.41T, member type = mirror
    /pci@7b,0/pci10de,5d@d/pci1077,142@0/fp@0,0   210000d0231c50ab,0  ONLINE
    /pci@7b,0/pci10de,5d@e/pci1077,142@0/fp@0,0   220000d0232c50ab,0  ONLINE
/scsi_vhci/disk@g600d0230006c1c4c0c50be4dfe511b00
  (Vendor = ADVUNI   Model = OXYGENRAID 416F4 Rev. = 347B VolID = 4DFE511B)
   ZFS: pool name = atl1, ZFS Version: 4
   ZFS: size = 698.37G, member type = mirror
    /pci@7b,0/pci10de,5d@d/pci1077,142@0/fp@0,0   220000d0232c50be,1  ONLINE
    /pci@7b,0/pci10de,5d@e/pci1077,142@0/fp@0,0   210000d0231c50be,1  ONLINE
/scsi_vhci/disk@g600d0230006c1c4c0c50be16ff1fe200
  (Vendor = ADVUNI   Model = OXYGENRAID 416F4 Rev. = 347B VolID = 16FF1FE2)
   ZFS: pool name = atl2, ZFS Version: 4
   ZFS: size = 3.41T, member type = mirror
    /pci@7b,0/pci10de,5d@d/pci1077,142@0/fp@0,0   220000d0232c50be,2  ONLINE
    /pci@7b,0/pci10de,5d@e/pci1077,142@0/fp@0,0   210000d0231c50be,2  ONLINE
/scsi_vhci/disk@g600d0230006c1c4c0c50be57396e9f00
  (Vendor = ADVUNI   Model = OXYGENRAID 416F4 Rev. = 347B VolID = 57396E9F)
   ZFS: pool name = atl2, ZFS Version: 4
   ZFS: size = 3.41T, member type = mirror
    /pci@7b,0/pci10de,5d@d/pci1077,142@0/fp@0,0   220000d0232c50be,0  ONLINE
    /pci@7b,0/pci10de,5d@e/pci1077,142@0/fp@0,0   210000d0231c50be,0  ONLINE



Return code equals the number of failed/offline links. It should be 0 (zero).

If you want to rebuild your device tree option "-p", it will create the device tree snapshot with the option DINFOFORCE, so all devices are reprobed.
Warning: This may block your terminal session for some time, so don't be shocked.


Access download directory.


0 TrackBacks

Listed below are links to blogs that reference this entry: vhci_stat.

TrackBack URL for this entry: http://southbrain.com/mt/mt-tb.cgi/42

6 Comments

Thank you for the code!

I am using it for Solaris 9, without ZFS header file.
So here are two places need to be updated other than removing the ZFS DEF and lib from makefile.

#ifdef ZFS
if (dozfs)
{
do_zfs(di_devfs_path(entry));
}
#endif

...
#ifdef ZFS
if (dozfs==1)
{
do_zfs(di_devfs_path(entry));
}
#endif

Thank you very much!

I'll incorporate that little change in the code and re-releasing it the next hours!

Very useful! Thanks. Have always complained about lack of status tools for mpxio - so this is great

-srini

I just wanted to thank you for putting this out there - that is absolutely superb and is a great help to me!

^^Thank you, it's very useful...^^
and can i get information for hba traffic on vhci_stat?

@TJ Chong:

Just use "iostat" with the "Y" option, e.g.

# iostat -xnzY 5

December 2015

Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

About

This blog is owned by:

Pascal Gienger
J├Ągerstrasse 77
8406 Winterthur
Switzerland


Google+: Profile
YouTube Channel: pascalgienger