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: //lib/python3/dist-packages/sos/report/plugins/__pycache__/gluster.cpython-38.pyc
U

i��dF�@sJddlZddlZddlZddlZddlmZmZmZGdd�dee�ZdS)�N)�Plugin�RedHatPlugin�	PluginOptc@sLeZdZdZdZdZdZdZdZe	ddd	d
�gZ
dd�Zd
d�Zdd�Z
dS)�GlusterzGlusterFS storageZgluster)ZstorageZvirtz/run/gluster)Z	glusterfszglusterfs-core)z
/etc/glusterdz/var/lib/glusterd�dumpFzenable glusterdump support)�defaultZdescc	
szd}�fdd���|�D�}|D]T}|d}��||�}d}|dkr t|d��}|��d}t�|d�}W5QRXq<q dS)Nrcsg|]}��|�r|�qS�)Zpath_isfile)�.0�f��selfr�</usr/lib/python3/dist-packages/sos/report/plugins/gluster.py�
<listcomp>!s
z.Gluster.wait_for_statedump.<locals>.<listcomp>�����rZ
DUMP_END_TIME)�listdirZ	path_join�open�	readlines�string�count)	rZname_dirZstatedumps_presentZstatedump_entriesZstatedump_fileZ_spathZretZsfile�	last_linerrr
�wait_for_statedumps
�zGluster.wait_for_statedumpcCsr|�d�rn|�|j�sdSz>t�|jd�}|�t�|jd��|D]}t�|�qFWntk
rlYnXdS)Nrz/*.dump.[0-9]*z/glusterd_state_[0-9]*_[0-9]*)�
get_option�path_exists�
statedump_dir�glob�extend�os�remove�OSError)rZremove_files�namerrr
�postproc-s
�zGluster.postproccCs�|�d�|�d�|jddd�|�d�|jddd�|�d	d
ddd
ddgt�d��|�d�sx|�dddg�n
|�d�|�d��r&|�|j�r�d}|�|�ddkr�t�	d�|�
|j�|�|j�q�|j�d�n|j�
d|j�|�d�}|ddk�r&|d��d}|�|�|jd d!d�}|ddk�r�|d��D]h}|�d"��sb�qN|d#d�}|�d$|d%|d&|d'|d(|d)|d*|d+|d,|d-|g
��qNdS).Nz,/var/lib/glusterd/geo-replication/secret.pemz6/var/lib/glusterd/glusterfind/glusterfind_*_secret.pemzgluster peer statusZgluster_peer_status)Ztagszgluster pool listzgluster volume statusZgluster_v_statusz/etc/redhat-storage-releasez/etc/swift/z/etc/glusterd.rpmsavez/etc/glusterfsz/var/lib/glusterd/z(/run/gluster/shared_storage/nfs-ganesha/z$/var/lib/glusterd/glusterfind/.keys/z/run/gluster/*tier-dht/*Zall_logsz/var/log/glusterfs/*logz/var/log/glusterfs/*/*logz)/var/log/glusterfs/geo-replication/*/*logz/var/log/glusterfsrz+killall -USR1 glusterfs glusterfsd glusterdZstatusrrz6could not send SIGUSR1 to glusterfs/glusterd processesz4Unable to generate statedumps, no such directory: %szgluster get-state�outputrzgluster volume infoZgluster_v_infozVolume Name:�zgluster volume get %s allz(gluster volume geo-replication %s statuszgluster volume heal %s infoz'gluster volume heal %s info split-brainz gluster volume status %s clientszgluster snapshot list %szgluster volume quota %s listz"gluster volume rebalance %s statuszgluster snapshot info %szgluster snapshot status %s)Zadd_forbidden_pathZadd_cmd_outputZ
add_copy_specrrrrZexec_cmd�time�sleeprZsoslog�infoZwarning�splitZcollect_cmd_output�
splitlines�
startswith)rZ
statedump_cmd�stateZ
state_fileZ
volume_cmd�lineZvolnamerrr
�setup:s|
�
��
�
�

�

��z
Gluster.setupN)�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofilesrZpackages�filesrZoption_listrr"r-rrrr
rs�
r)	r%rrrZsos.report.pluginsrrrrrrrr
�<module>	s