Accessing statistics in sysfs
You can read the statistics from the files attributes in the sysfs file system. Depending on the information type the location of the attributes varies.
The latencies are provided on a device level and are therefore located in the SCSI device section. The other statistics are on the FCP device level and are located in the SCSI host section. Reference the following list for a detailed description of the location of the zfcp statistics.
- /sys/class/scsi_host/host<n>/seconds_active
- /sys/class/scsi_host/host<n>/requests
- /sys/class/scsi_host/host<n>/megabytes
- /sys/class/scsi_host/host<n>/utilization
- /sys/class/scsi_device/<H:C:T:L/device/cmd_latency
- /sys/class/scsi_device/<H:C:T:L>/device/read_latency
- /sys/class/scsi_device/<H:C:T:L>/device/write_latency
- <n> denotes an integer, for example host0 or host3 depending on how many FCP devices are configured for the system.
- <H:C:T:L> stands for Host, Channel, Target, and Lun and describes the referenced storage (for example, disk).
Example
To check for how long the host0 has been active, issue:
# cat /sys/class/scsi_host/host0/seconds_active 66 #
Reading from the file seconds_active with the cat command provides a value of 66 resulting in the information that the host0 is active for the last 66 seconds. Other attributes can be queried the same way, however, the content might need to be interpreted differently.