HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib/python3/dist-packages/sos/report/plugins/__pycache__/shmcli.cpython-38.pyc
U

i��d��@s*ddlmZmZmZGdd�dee�ZdS)�)�Plugin�IndependentPlugin�	PluginOptc@s>eZdZdZdZdZdZdZefZe	dddd	�gZ
d
d�ZdS)
�SHMcliashmcli pulls hardware information from PowerVault/Dell
    Storage JBOD's attached to server.
    It provides information of the adapters, emms, drives,
    enclosures, fans, power supplies and the sensory data of
    temp, voltage, and current sensors.
    zDell Server Hardware Manager�shmcli)�systemZstorageZhardwarezC/opt/dell/ServerHardwareManager/ServerHardwareManagerCLI/bin/shmcli�debugFzcapture support debug data)�defaultZdescc
s*|j}dddg}|D]}|jd||fd|d�qg}|�d�}|dd	kr�|d
��D]:}|��}t|�dkrZ|d��dkrZ|�|��d
�qZtt	|��}ddddddddddg
}|j
d|dd�}|dd	k�r�|d
��dd�D]�}|���t�fdd�|D��r�d}�d	}	|D]0}d||||	f}
|
�|d�}|j|
|d��q$|�
d �r�|jd!d"�}d#|||	f}
|
�|d�}d$|}|j|
||d%d&�q�|j
d'|d(d�}|dd	k�r&|d
��D]T}|��}t|�d)k�r�|d	d*k�r�d+||d	f}
|
�|d�}|j|
|d��q�dS),Nz
list adapterszlist physical enclosureszlist failed drivesz%s %sz	shmcli_%s)�suggest_filenamez	lsscsi -gZstatusr�output�ZDELL�z	list emmszlist drawerszlist emm slotszlist drive slotsz	list fanszlist temp sensorszlist voltage sensorszlist current sensorszlist power supplieszinfo enclosurez%s list enclosuresZshmcli_list_enclosures���c3s|]}|�kVqdS)N�)�.0�m��_liner�;/usr/lib/python3/dist-packages/sos/report/plugins/shmcli.py�	<genexpr>MszSHMcli.setup.<locals>.<genexpr>���z%s %s -a=%s -enc=%srrF)Zmakez%s getdebugcli -a=%s -enc=%sz -outputdir=%si,)r
Ztimeoutz%s list drivesZshmcli_list_drives�)ZWWNz---z%s info drive -d=%s)�
shmcli_binZadd_cmd_outputZexec_cmd�
splitlines�split�len�upper�append�list�setZcollect_cmd_output�any�replaceZ
get_optionZget_cmd_output_path)�self�cmdZsubcmdsZsubcmdZmodels�result�lineZwordsZadapt_indexZ	enc_indexZ_cmdZ_fnameZlogpathZ_dcmdZ_dnameZ_odirrrr�setup s��
�
�
�
�
���
�zSHMcli.setupN)�__name__�
__module__�__qualname__�__doc__Z
short_descZplugin_nameZprofilesr�filesrZoption_listr&rrrrrs�rN)Zsos.report.pluginsrrrrrrrr�<module>	s