Your IP : 216.73.217.13


Current Path : /lib/python3/dist-packages/sos/report/plugins/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/sos/report/plugins/__pycache__/ceph_mon.cpython-38.pyc

U

���b!�@s4ddlmZmZmZddlZGdd�deee�ZdS)�)�Plugin�RedHatPlugin�UbuntuPluginNc@s4eZdZdZdZdZdZdd�Zdd�Zd	d
�Z	dS)�CephMONzCEPH monZceph_mon)ZstorageZvirt�	container)z
ceph-mon.*cCst�d�rdSdS)Nz/var/lib/ceph/mon/*/*TF)�glob)�self�r	�=/usr/lib/python3/dist-packages/sos/report/plugins/ceph_mon.py�
check_enabledszCephMON.check_enabledcCs�|�ddd��|�dddg�|�ddd	d
ddd
dddddddddddddddg�dddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2g}|jd3d4�|D�d5d6d7�g}|�d8�}|dd9k�r0|d:��D]f}|��}|r�|d9�d;�r�z |�d<�}|�||d=�Wq�t	t
fk
�r,|�d>|�Yq�Xq�|jd?d4�|D�d5d6d7�|�d@dAdBdCdDdEg�z|�
dF�d9d=}Wntk
�r�d}YnX|jdGd4�|D�|dH�dS)INZ	ceph_confZceph_mon_log)z.*/ceph.confz/var/log/ceph/ceph-mon.*.logz/run/ceph/ceph-mon*z/var/lib/ceph/mon/*/kv_backendz/var/log/ceph/ceph-mon*.logz
ceph mon statzceph quorum_statuszceph reportzceph-disk listz
ceph versionsz
ceph featuresz
ceph insightszceph crash statz
ceph crash lszceph config logz!ceph config generate-minimal-conf�ceph config-key dumpzceph osd metadataz ceph osd erasure-code-profile lszceph osd crush dumpzceph osd crush show-tunablesz!ceph osd crush tree --show-shadowz
ceph mgr dumpzceph mgr metadatazceph mgr module lszceph mgr serviceszceph mgr versionszmon dumpZstatusz
health detailz	device lsZdfz	df detailzfs lszfs dumpzpg dumpzpg statztime-sync-statuszosd treezosd statzosd df treezosd dumpzosd dfzosd perfzosd blocked-byzosd pool ls detailzosd pool autoscale-statuszmds statzosd numa-statuscSsg|]}d|�qS)zceph %s --format json-prettyr	)�.0�sr	r	r
�
<listcomp>Ysz!CephMON.setup.<locals>.<listcomp>Zjson_outputZinsights_ceph_health_detail)ZsubdirZtagszps -u ceph -o argsr�outputzceph-monz--id�zcould not find ceph-mon id: %scSsg|]}d|�qS)zceph tell mon.%s mon_statusr	)r
Zmon_idr	r	r
rmsz/etc/ceph/*keyring*z/var/lib/ceph/*keyring*z/var/lib/ceph/*/*keyring*z/var/lib/ceph/*/*/*keyring*z/var/lib/ceph/tmp/*mnt*z/etc/ceph/*bindpass*z	ceph-mon*cSsg|]}d|�qS)zceph %sr	)r
�cmdr	r	r
r�s)r)Z
add_file_tagsZ
add_copy_specZadd_cmd_outputZexec_cmd�
splitlines�split�endswith�index�append�
IndexError�
ValueErrorZlog_warnZadd_forbidden_pathZget_all_containers_by_regex�	Exception)rZ	ceph_cmdsZmon_ids�outZprocs�procZid_indexZcnamer	r	r
�setups�����
��


���
�z
CephMON.setupcCs0ddddddg}dd�|�}|�d	|d
�dS)NZAPI_PASSWORDz
API_USER.*z
API_.*_KEY�keyZ_secretzrbd/mirror/peer/.*z((\".*(%s)\":) \")(.*)(\".*)�|rz\1*******\5)�joinZdo_cmd_output_sub)r�keysZcregr	r	r
�postproc�s�	zCephMON.postprocN)
�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofilesZ
containersrrr"r	r	r	r
r
sor)Zsos.report.pluginsrrrrrr	r	r	r
�<module>	s