HEX
Server: Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System: Linux ns565604.ip-54-39-133.net 4.18.0-553.50.1.el8_10.x86_64 #1 SMP Tue Apr 15 08:09:22 EDT 2025 x86_64
User: greer489 (1034)
PHP: 8.3.19
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/sos/report/plugins/__pycache__/gluster.cpython-36.opt-1.pyc
3

-�_g��@sBddlZddlZddlZddlmZmZmZGdd�dee�ZdS)�N)�Plugin�RedHatPlugin�	PluginOptc@sLeZdZdZdZdZdZdZdZe	d
ddd
�gZ
dd�Zdd�Zdd�Z
dS)�GlusterzGlusterFS storageZgluster�storage�virtz/run/gluster�	glusterfs�glusterfs-core�
/etc/glusterd�/var/lib/glusterd�dumpFzenable glusterdump support)�defaultZdescc	
s�d}�fdd��j|�D�}xb|D]Z}|d}�j||�}d
}x<|dkrzt|ddd��}|j�d}|jd�}Wd	QRXq@Wq"Wd	S)
z Wait until state dump is done rcsg|]}�j|�r|�qS�)Zpath_isfile)�.0�f)�selfr�/usr/lib/python3.6/gluster.py�
<listcomp>"sz.Gluster.wait_for_statedump.<locals>.<listcomp>��rzUTF-8)�encodingZ
DUMP_END_TIMEN���rr)�listdirZ	path_join�open�	readlines�count)	rZname_dirZstatedumps_presentZstatedump_entriesZstatedump_fileZ_spath�retZsfile�	last_liner)rr�wait_for_statedumps

zGluster.wait_for_statedumpcCs�|jd�r�|j|j�sdSyBtj|jd�}|jtj|jd��x|D]}tj|�qHWWn2tk
r�}z|jd|���WYdd}~XnXdS)Nrz/*.dump.[0-9]*z/glusterd_state_[0-9]*_[0-9]*z"Could not remove statedump files: )	�
get_option�path_exists�
statedump_dir�glob�extend�os�remove�OSErrorZ
_log_error)rZremove_files�name�errrrr�postproc-s


zGluster.postprocc
Cs�|jd�|jd�|jddd�|jd�|jddd�|jd	d
ddd
ddgtjd��|jd�sx|jdddg�n
|jd�|jd��r$|j|j�r�d}|j|�ddkr�tj	d�|j
|j�|j|j�q�|jjd�n|jj
d|j�|jd�}|ddk�r$|dj�d2}|j|�|jdd d�}|ddk�r�x�|dj�D]�}|jd!��sb�qN|d"d�}|jd#|�d$�d%|�d&�d'|�d(�d'|�d)�d*|�d+�d,|��d-|�d.�d/|�d&�d0|��d1|��g
��qNWdS)3Nz,/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/glusterfsrz+killall -USR1 glusterfs glusterfsd glusterdZstatusrrz6could not send SIGUSR1 to glusterfs/glusterd processesz4Unable to generate statedumps, no such directory: %szgluster get-state�outputzgluster volume infoZgluster_v_infozVolume Name:�zgluster volume get z allzgluster volume geo-replication z statuszgluster volume heal z infoz info split-brainzgluster volume status z clientszgluster snapshot list zgluster volume quota z listzgluster volume rebalance zgluster snapshot info zgluster snapshot status r)Zadd_forbidden_pathZadd_cmd_outputZ
add_copy_specr"rr r!Zexec_cmd�timeZsleeprZsoslog�infoZwarning�splitZcollect_cmd_output�
splitlines�
startswith)rZ
statedump_cmd�stateZ
state_fileZ
volume_cmd�lineZvolnamerrr�setup:sl














z
Gluster.setupN)rr)rr	)r
r)�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofilesr!Zpackages�filesrZoption_listrr)r3rrrrrs
r)r"r$r,Zsos.report.pluginsrrrrrrrr�<module>	s