a >h @s2ddlmZddlmZmZGdddeeZdS))glob)PluginIndependentPluginc@s$eZdZdZdZdZdZddZdS)Scsia Collects various information about the SCSI devices install on the host system. This plugin will capture a large amount of data from the /sys filesystem, as well as several different invocations of the `lsscsi` command. Additionally, several `sg_persist` commands will be collected for each SCSI device identified by sos. Note that in most cases these commands are provided by the `sg3_utils` package which may not be present by default. z SCSI devicesZscsi)ZstorageZhardwarecCs|gddg}|d}|ddkrh|dD]0}|d|vr6|d}|d |q6|jd d d d |gd td}|jd|d|jgdddgddS)N)z /proc/scsiz/etc/stinit.defz /sys/bus/scsiz/sys/class/scsi_hostz/sys/class/scsi_diskz/sys/class/scsi_devicez/sys/class/scsi_genericZenclosuz lsscsi -gstatusroutputzsg_ses -p2 -b1 z lsscsi -iZlsscsi)Zsuggest_filenametags) z sg_map -xZlspathz lsmap -allZlsnportsz lsscsi -Hz lsscsi -dz lsscsi -sz lsscsi -Lz lsscsi -iwz lsscsi -tz/sys/class/scsi_host/*zudevadm info -a %(dev)s)devices)zsg_persist --in -k -d %(dev)szsg_persist --in -r -d %(dev)szsg_persist --in -s -d %(dev)szsg_inq %(dev)sblockzsd.*)r Z whitelist)Z add_copy_specZcollect_cmd_output splitlinessplitZadd_cmd_outputrZadd_device_cmd)selfZ scsi_typesresultlineZdevsgZ scsi_hostsr;/usr/lib/python3.9/site-packages/sos/report/plugins/scsi.pysetups"      z Scsi.setupN)__name__ __module__ __qualname____doc__Z short_descZ plugin_nameZprofilesrrrrrr s  rN)rZsos.report.pluginsrrrrrrr s