HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.60.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 5 05:00:59 EST 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //lib/python3.9/site-packages/sos/report/plugins/__pycache__/pacemaker.cpython-39.pyc
a

\��h?�@szddlZddlmZmZddlmZmZmZmZmZddl	m
Z
Gdd�de�ZGdd�deee�ZGd	d
�d
ee�Z
dS)�N)�datetime�	timedelta)�Plugin�RedHatPlugin�DebianPlugin�UbuntuPlugin�	PluginOpt)�sos_parse_versionc@sneZdZdZdZdZdZeddedd�ed	d
dd�gZ	dZ
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)�	Pacemakerz4Pacemaker high-availability cluster resource manager�	pacemaker)Zcluster)rzpacemaker-remote�crm-from�z%specfiy the start time for crm_report)�defaultZval_type�desc�	crm-scrubTz$enable crm_report password scrubbing)rrcCs|�d�dS)z Get cluster summary zcrm_mon -1 -A -n -r -tN��add_cmd_output��self�r�@/usr/lib/python3.9/site-packages/sos/report/plugins/pacemaker.py�
setup_crm_mon$szPacemaker.setup_crm_moncCs|�ddg�dS)z& Get cluster status and configuration z
crm status�crm configure showNrrrrr�setup_crm_shell(s�zPacemaker.setup_crm_shellcCs�|jj�d�}|durdS|�d�|�gd��d�|d�}t|�td�kr\|�d�n
|�d	�|jd
dd�|jd
dd�|jddd�dS)z& Get pacemaker/corosync configuration ZpcsNz/var/log/pcsd/pcsd.log)zpcs stonith sbd status --fullzpcs stonith sbd watchdog listzpcs stonith history show�.�versionz0.10.8zpcs property config --allzpcs property list --all�
pcs configZ
pcs_config)�tagszpcs quorum statusZpcs_quorum_statuszpcs status --fullZ
pcs_status)ZpolicyZpackage_managerZpkg_by_name�
add_copy_specr�joinr	)rZpcs_pkgZpcs_versionrrr�	setup_pcs/s

zPacemaker.setup_pcscCs|�ddd�dS)� Clear password r�passw([^\s=]*)=\S+�passw\1=********N�Zdo_cmd_output_subrrrr�postproc_crm_shellFs
�zPacemaker.postproc_crm_shellcCs|�ddd�dS)r!rr"r#Nr$rrrr�postproc_pcsNs
�zPacemaker.postproc_pcsc	Csr|�gd��|��t��tdd��d�}|�d�rrt�dt	|�d���rZ|�d�}n|�
d|�d��d��|jd	d
d�}|�d�r�d
}nd}|�d�|�d�|j
d|�d|�d|�d�|��d�d}|�|j��rn|�|j�t|jddd��`}|D]J}t�||��rt�||��d�}dD]}t�|d|�}�q*|�|��qWd�n1�sd0YdS)N)z!/var/log/pacemaker/pacemaker.log*�/var/log/pacemaker/bundles/*/z/var/log/pacemaker/pengine*z/var/log/pacemaker.logr'z/var/log/cluster/pacemaker.log*z/var/log/cluster/bundles/*/�H)Zhoursz%Y-%m-%d %H:%m:%Srz#\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}zcrm_from parameter 'z$' is not a valid date: using defaultZ
crm_reportF)�nameZmakerz-p "passw.*"r
z-scrubbing of crm passwords has been disabled:z:data collected by crm_report may contain sensitive values.zcrm_report --sos-mode z -S -d  --dest z	 --from "�")�chrootz0^\s*PCMK_logfile=[\'\"]?(\S+)[\'\"]?\s*(\s#.*)?$�rzUTF-8)�encoding�)z^"z"$z^\'z\'$)rrrZtodayr�strftimeZ
get_option�re�match�strZ
_log_errorZget_cmd_output_pathZ	_log_warnrZtmp_in_sysrootZpath_isfile�envfile�open�search�group�sub)	rZcrm_fromZcrm_destZ	crm_scrub�pattern�file�lineZlogfileZregexprrr�setupVsL��
��


���zPacemaker.setupN)�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofilesZpackagesrr2Zoption_listr3rrr r%r&r;rrrrr
s$���r
cs$eZdZ�fdd�Zdd�Z�ZS)�DebianPacemakercs*|�d�|_|��|��t���dS)Nz/etc/default/pacemaker)�	path_joinr3rr �superr;r��	__class__rrr;�szDebianPacemaker.setupcCs|��|��dS�N)r%r&rrrr�postproc�szDebianPacemaker.postproc�r<r=r>r;rE�
__classcell__rrrBrr?�sr?cs$eZdZ�fdd�Zdd�Z�ZS)�RedHatPacemakercs,|�d�|_|��|�d�t���dS)Nz/etc/sysconfig/pacemakerz/etc/sysconfig/sbd)r@r3r rrAr;rrBrrr;�s
zRedHatPacemaker.setupcCs|��dSrD)r&rrrrrE�szRedHatPacemaker.postprocrFrrrBrrH�srH)r0rrZsos.report.pluginsrrrrrZ
sos.utilitiesr	r
r?rHrrrr�<module>	s