U
    -_g
                     @   s.   d dl Z d dlmZmZ G dd deeZdS )    N)PluginRedHatPluginc                   @   s,   e Zd ZdZdZdZdZdd Zdd Zd	S )
LustrezLustre filesystemlustre)ZstorageZnetworkZcluster)r   zlustre-clientc                 C   s&   | j dd| d| dd dS )zZUse lctl get_param to collect a selection of parameters into a
            file.

        zlctl get_param  zparams-F)Zsuggest_filenamestderrN)add_cmd_outputjoin)selfnameZ
param_list r   ;/usr/lib/python3/dist-packages/sos/report/plugins/lustre.py
get_params   s    zLustre.get_paramsc                    s   |  dddddg | dd }d  fd	d
| D }| d| | ddddg |  ddg | dddddg | ddg | ddg | dddg | d | dd g | d!r| d" | d#d$g | d%d%g d S )&Nzlctl debug_kernelzlctl device_listzlctl list_nidszlctl route_listzlnetctl net show -v 4zlctl list_param -R *outputzn.*@.*|.*dump_page_cache|peers|.*quota.*|osd-.*|.*osc.*|mgs.*|.*mgc_irstate|ldlm.*state|.*job_stats|.*exports.*c                    s   g | ]}t  |s|qS r   )rematch).0itemZexcluder   r   
<listcomp>+   s    z Lustre.setup.<locals>.<listcomp>allZbasicversionZhealth_checkdebugzlfs dfz	lfs df -iZ
osc_clientzosc.*.max_dirty_mbzosc.*.max_pages_per_rpczosc.*.checksumszosc.*.max_rpcs_in_flightZosdz3osd-*.*.{mntdev,files*,kbytes*,blocksize,brw_stats}Zquotaz)osd-*.*.quota_slave.{info,limit_*,acct_*}Zmgszmgs.MGS.ir_timeoutzmgs.MGS.live.*z*/mb_groupsz/sys/fs/ldiskfsz/proc/fs/ldiskfsZall_logsz/tmp/lustre-log.*z	job-statsz*.*.job_statsZpeers)r   Zexec_cmd
splitlinesr   Zadd_forbidden_pathZadd_copy_specZ
get_option)r
   r   Zparamsr   r   r   setup   sP    	


zLustre.setupN)	__name__
__module____qualname__Z
short_descZplugin_nameZprofilesZpackagesr   r   r   r   r   r   r      s   	r   )r   Zsos.report.pluginsr   r   r   r   r   r   r   <module>	   s   