Sindbad~EG File Manager

Current Path : /lib/python3.6/site-packages/sos/report/plugins/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/sos/report/plugins/__pycache__/shmcli.cpython-36.opt-1.pyc

3

�fG�@s*ddlmZmZmZGdd�dee�ZdS)�)�Plugin�IndependentPlugin�	PluginOptc@sNeZdZdZdZdZdZdZefZe	dd	d
d�gZ
dd
�Zdd�Zdd�Z
dS)�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�system�storage�hardwarezC/opt/dell/ServerHardwareManager/ServerHardwareManagerCLI/bin/shmcli�debugFzcapture support debug data)�defaultZdesccCsHdddg}x(|D] }|jd|j|fd|d�qW|j�|j�dS)Nz
list adapterszlist physical enclosureszlist failed drivesz%s %sz	shmcli_%s)�suggest_filename)�add_cmd_output�
shmcli_bin�collect_enclosures_list�collect_drivers_list)�self�subcmds�subcmd�r�/usr/lib/python3.6/shmcli.py�setup s
zSHMcli.setupc
s�g}|jd�}|ddkrfxJ|dj�D]:��j�}t|�dkr(|dj�dkr(|j�j�d�q(Wtt|��}dd	d
ddd
ddddg
}|jd|j	dd�}|ddk�r�x�|dj�dd"�D]���j��t
�fdd�|D��rˆd#}�d}x<|D]4}d|j	|||f}|j|j	d�}	|j||	d��q�W|j
d�r�|jdd�}
d|j	||f}|j|j	d�}d|
}
|j||
|dd �q�Wd!S)$z  Collect info on the enclosures z	lsscsi -g�statusr�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)rc3s|]}|�kVqdS)Nr)�.0�m)�linerr�	<genexpr>Qsz1SHMcli.collect_enclosures_list.<locals>.<genexpr>�z%s %s -a=%s -enc=%srr
F)Zmakez%s getdebugcli -a=%s -enc=%sz -outputdir=%si,)rZtimeoutN������)Zexec_cmd�
splitlines�split�len�upper�append�list�set�collect_cmd_outputr�any�replacer
Z
get_optionZget_cmd_output_path)rZmodels�result�wordsrZadapt_indexZ	enc_indexr�_cmd�_fnameZlogpathZ_dcmdZ_dnameZ_odirr)rrr0sT



zSHMcli.collect_enclosures_listcCs�|jd|jdd�}|ddkr�xb|dj�D]R}|j�}t|�dkr.|dd
kr.d
|j|df}|j|jd�}|j||d�q.WdS)z Collect info on the drives z%s list drivesZshmcli_list_drives)rrrr��WWN�---z%s info drive -d=%srN)r1r2)r)rr"r#r$r+r
)rr,rr-r.r/rrrreszSHMcli.collect_drivers_listN)rrr	)�__name__�
__module__�__qualname__�__doc__Z
short_descZplugin_nameZprofilesr�filesrZoption_listrrrrrrrrs5rN)Zsos.report.pluginsrrrrrrrr�<module>	s

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists