Storage‎ > ‎Storage-disk‎ > ‎

systool, a useful tool for SAN, as well for sysfs devices

Thank you for visiting this page, this page has been update in another link Systool, a useful tool for SAN as well for sysfs devices


More clear than I can say,from man page of systool:

systool - view system device information by bus, class, and topology
Synopsis
systool [options [device]]
Description
Calling systool without parameters will present all available bus types, device classes, and root devices.

When device is supplied, the information reqested by options is shown only for the specified device, otherwise all present devices are displayed.

systool uses APIs provided by libsysfs to gather information. systool runs only on Linux systems running kernels 2.5 or later, with the sysfs filesystem mounted.

Here are some examples:

#systool
Supported sysfs buses:
        scsi
        usb
...
Supported sysfs classes:
        sas_host
        scsi_device
        scsi_disk
        scsi_generic
        scsi_host
        usbmon
...
Supported sysfs devices:
        cpu
        system
...
Supported sysfs modules:
        tpm_tis
        usbnet
        vt
        xfs
...

# systool -c fc_host -v | more
Class = "fc_host"

  Class Device = "host5"
  Class Device path = "/sys/devices/pci0000:00/0000:00:03.0/0000:15:00.0/host5/fc_host/host5"
    dev_loss_tmo        = "30"
    fabric_name         = "0x1000000533b6dd57"
    issue_lip           = <store method only>
    max_npiv_vports     = "254"
    node_name           = "0x20000024ff3434e4"
    npiv_vports_inuse   = "0"
    port_id             = "0x010000"
    port_name           = "0x21000024ff3434e4"
    port_state          = "Online"
    port_type           = "NPort (fabric via point-to-point)"
    speed               = "8 Gbit"
    supported_classes   = "Class 3"
    supported_speeds    = "1 Gbit, 2 Gbit, 4 Gbit, 8 Gbit"
    symbolic_name       = "QLE2562 FW:v5.08.00 DVR:v8.04.00.08.06.4-k"
    system_hostname     = ""
    tgtid_bind_type     = "wwpn (World Wide Port Name)"
    uevent              =
    vport_create        = <store method only>
    vport_delete        = <store method only>

If you only want to get host5 info, then here you go
# systool -c fc_host -v -d host5
Well, module detail info
# systool -m qla2xxx -v
Module = "qla2xxx"

  Attributes:
    initstate           = "live"
    refcnt              = "288"
    srcversion          = "C5EBE96340369EB294E6D44"
    version             = "8.04.00.08.06.4-k"

  Parameters:
    ql2xallocfwdump     = "1"
    ql2xasynclogin      = "1"
...

To get HBA info
# systool -c fc_host -A port_name
Class = "fc_host"

  Class Device = "host5"
    port_name           = "0x21000024ff3434e4"

    Device = "host5"


  Class Device = "host6"
    port_name           = "0x21000024ff3434e5"

    Device = "host6"

Check scsi disk path
# systool -c scsi_disk  -d 0:5:0  -p           
Class = "scsi_disk"

  Class Device = "0:5:0"
  Class Device path = "/sys/devices/pci0000:00/0000:00:03.0/0000:15:00.0/host5/rport-5:0-7/target5:0:5/5:0:5:0/scsi_disk/5:0:5:0"
    Device = "5:0:5:0"
    Device path = "/sys/devices/pci0000:00/0000:00:03.0/0000:15:00.0/host5/rport-5:0-7/target5:0:5/5:0:5:0"


  Class Device = "0:5:0"
  Class Device path = "/sys/devices/pci0000:00/0000:00:03.0/0000:15:00.1/host6/rport-6:0-8/target6:0:5/6:0:5:0/scsi_disk/6:0:5:0"
    Device = "6:0:5:0"
    Device path = "/sys/devices/pci0000:00/0000:00:03.0/0000:15:00.1/host6/rport-6:0-8/target6:0:5/6:0:5:0"


Get usb info
# systool -b usb -d usb1  -v
Bus = "usb"

  Device = "usb1"
  Device path = "/sys/devices/pci0000:00/0000:00:1a.7/usb1"
    authorized          = "1"
...

Check local disk
#  systool -c scsi_disk -v 1:0:0
Class = "scsi_disk"

  Class Device = "1:0:0"
  Class Device path = "/sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0/host0/target0:1:0/0:1:0:0/scsi_disk/0:1:0:0"
    FUA                 = "0"
    allow_restart       = "0"
    app_tag_own         = "0"
    cache_type          = "write through"
    manage_start_stop   = "0"
    protection_mode     = "none"
    protection_type     = "0"
    provisioning_mode   = "full"
    thin_provisioning   = "0"
    uevent              =

    Device = "0:1:0:0"
    Device path = "/sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0/host0/target0:1:0/0:1:0:0"
      delete              = <store method only>
      device_blocked      = "0"
      dh_state            = "detached"
      evt_media_change    = "0"
      iocounterbits       = "32"
      iodone_cnt          = "0x28eab"
      ioerr_cnt           = "0x35"
      iorequest_cnt       = "0x28eab"
      modalias            = "scsi:t-0x00"
      model               = "Logical Volume  "
      queue_depth         = "128"
      queue_ramp_up_period= "120000"
      queue_type          = "simple"
      rescan              = <store method only>
      rev                 = "3000"
      sas_address         = "0x0396c469eb687835"
      sas_device_handle   = "0x00b5"
      scsi_level          = "7"
      state               = "running"
      timeout             = "30"
      type                = "0"
      uevent              = "DEVTYPE=scsi_device
DRIVER=sd
MODALIAS=scsi:t-0x00"
      vendor              = "LSI     "

FC remote port info
#  systool -c fc_remote_ports -v -d 0-8
Class = "fc_remote_ports"

  Class Device = "0-8"
  Class Device path = "/sys/devices/pci0000:00/0000:00:03.0/0000:15:00.0/host5/rport-5:0-8/fc_remote_ports/rport-5:0-8"
    dev_loss_tmo        = "30"
    fast_io_fail_tmo    = "off"
    node_name           = "0x20000024ff3434d4"
    port_id             = "0x010200"
    port_name           = "0x21000024ff3434d4"
    port_state          = "Online"
    roles               = "FCP Initiator"
    scsi_target_id      = "-1"
    supported_classes   = "Class 3"
    uevent              =

    Device = "rport-5:0-8"
    Device path = "/sys/devices/pci0000:00/0000:00:03.0/0000:15:00.0/host5/rport-5:0-8"
      uevent              =


  Class Device = "0-8"
  Class Device path = "/sys/devices/pci0000:00/0000:00:03.0/0000:15:00.1/host6/rport-6:0-8/fc_remote_ports/rport-6:0-8"
    dev_loss_tmo        = "30"
    fast_io_fail_tmo    = "off"
    node_name           = "0x20060080e52d2652"
    port_id             = "0x011200"
    port_name           = "0x20460080e52d2652"
    port_state          = "Online"
    roles               = "FCP Target"
    scsi_target_id      = "5"
    supported_classes   = "Class 3"
    uevent              =

    Device = "rport-6:0-8"
    Device path = "/sys/devices/pci0000:00/0000:00:03.0/0000:15:00.1/host6/rport-6:0-8"
      uevent              =


Comments