File: //usr/lib/python3/dist-packages/sos/report/plugins/__pycache__/hpssm.cpython-38.pyc
U
i��d�
� @ s2 d dl mZmZmZ d dlZG dd� dee�ZdS )� )�Plugin�IndependentPlugin� PluginOptNc @ s@ e Zd ZdZdZdZdZdZedddd �gZ d
d� Z
dd
� ZdS )�HpssmaG
This plugin will capture details for each controller from Smart Storage
Array Administrator, an Array diagnostic report from Smart Storage
Administrator Diagnostics Utility and, when the plugins debug option is
enabled will gather the Active Health System log via the RESTful Interface
Tool (iLOREST).
zHP Smart Storage ManagementZhpssm)�systemZstorageZhardware)Zilorest�ssacliZssaducli�debugFzcapture debug data)�defaultZdescc s� d� dg}ddddddg�| � � fd d
�|D �� t�d��� d }| �|�}g }|d
dkrx�fdd
�|d �� D �}� d �| � ��fdd
�|D �� | �� }| j d| dd� | �d�r�| �|� d S )Nr zctrl all show statuszarray all show detailzld all showzld all show detailzpd all showzpd all show detailzshow detailc s g | ]}d � |f �qS )z%s %s� )�.0Zsubcmd)�cmdr
�:/usr/lib/python3/dist-packages/sos/report/plugins/hpssm.py�
<listcomp>- s zHpssm.setup.<locals>.<listcomp>z,^HP.*Smart Array (.*) in Slot ([0123456789])z ctrl all show config detailZstatusr c s, g | ]$}� � |�fD ]}|r|�d ��qqS )� )�search�group)r �line�m)�patternr
r
r 5 s
��outputz ctrl slot=c s$ g | ]}� D ]}d �||f �qqS )z%s%s %sr
)r ZslotZslot_subcmd)�slot_subcmds�ssacli_ctrl_slot_cmdr
r
r : s ��z"ssaducli -v -adu -f %s/adu-log.zipzssaducli_-v_-adu.log)�suggest_filenamer )�add_cmd_output�re�compileZcollect_cmd_output�
splitlinesZget_cmd_output_pathZ
get_option�do_debug)�selfZsubcmdsZconfig_detail_cmdZ
config_detailZ
ctrl_slots�logpathr
)r r r r r
�setup sD ���
���
�
zHpssm.setupc C s | j d| |dd� d S )Nz5ilorest serverlogs --selectlog=AHS --directorypath=%szilorest.log)Zrunatr )r )r r r
r
r
r M s
�zHpssm.do_debugN)�__name__�
__module__�__qualname__�__doc__Z
short_descZplugin_nameZprofilesZpackagesr Zoption_listr r r
r
r
r
r
s �.r )Zsos.report.pluginsr r r r r r
r
r
r
�<module> s