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

i��d*�@snddlmZmZmZmZmZddlmZmZddlZGdd�de�Z	Gdd�de	ee�Z
Gdd	�d	e	e�ZdS)
�)�Plugin�RedHatPlugin�DebianPlugin�UbuntuPlugin�	PluginOpt)�datetime�	timedeltaNc@sneZdZdZdZdZdZeddedd�ed	d
dd�gZ	dZ
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)�	Pacemakerz4Pacemaker high-availability cluster resource manager�	pacemaker)Zcluster)r
zpacemaker-remote�crm_from�z%specfiy the start time for crm_report)�defaultZval_type�desc�	crm_scrubTz$enable crm_report password scrubbing)r
rcCs|�d�dS)Nzcrm_mon -1 -A -n -r -t��add_cmd_output��self�r�>/usr/lib/python3/dist-packages/sos/report/plugins/pacemaker.py�
setup_crm_mon#szPacemaker.setup_crm_moncCs|�ddg�dS)Nz
crm status�crm configure showrrrrr�setup_crm_shell&s�zPacemaker.setup_crm_shellcCsJ|�d�|�ddddg�|jddd�|jd	d
d�|jddd�dS)
Nz/var/log/pcsd/pcsd.logzpcs stonith sbd status --fullzpcs stonith sbd watchdog listzpcs stonith history showzpcs property list --all�
pcs configZ
pcs_config)Ztagszpcs quorum statusZpcs_quorum_statuszpcs status --fullZ
pcs_status)�
add_copy_specrrrrr�	setup_pcs,s
�zPacemaker.setup_pcscCs|�ddd�dS)Nr�passw([^\s=]*)=\S+�passw\1=********�Zdo_cmd_output_subrrrr�postproc_crm_shell8s
�zPacemaker.postproc_crm_shellcCs|�ddd�dS)Nrrrrrrrr�postproc_pcs?s
�zPacemaker.postproc_pcsc		CsN|�dddddddg�|��t��tdd��d	�}|�d
�rxt�dt	|�d
���rd|�d
�}n|�
d|�d
��|jd
dd�}|�d�r�d}nd}|�d�|�d�|j
d|||f|��d�d}|�|j��rJ|�|j�t|j��R}|D]F}t�||�r�t�||��d�}dD]}t�|d|�}�q|�|�q�W5QRXdS)Nz!/var/log/pacemaker/pacemaker.log*z/var/log/pacemaker/bundles/*/z/var/log/pacemaker/pengine*z/var/log/pacemaker.logz/var/log/cluster/pacemaker.log*z/var/log/cluster/bundles/*/�H)Zhoursz%Y-%m-%d %H:%m:%Srz#\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}z:crm_from parameter '%s' 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.z5crm_report --sos-mode %s -S -d  --dest %s --from "%s")�chrootz0^\s*PCMK_logfile=[\'\"]?(\S+)[\'\"]?\s*(\s#.*)?$�)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)	rrZcrm_destr�pattern�f�lineZlogfileZregexprrr�setupFs\���
���


��zPacemaker.setupN)�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofilesZpackagesrr(Zoption_listr)rrrrr r1rrrrr	s$���r	cs$eZdZ�fdd�Zdd�Z�ZS)�DebianPacemakercs.|�d�|_|��|��tt|���dS)Nz/etc/default/pacemaker)�	path_joinr)rr�superr5r1r��	__class__rrr1�szDebianPacemaker.setupcCs|��|��dS�N)rr rrrr�postproc�szDebianPacemaker.postproc�r2r3r4r1r;�
__classcell__rrr8rr5�sr5cs$eZdZ�fdd�Zdd�Z�ZS)�RedHatPacemakercs0|�d�|_|��|�d�tt|���dS)Nz/etc/sysconfig/pacemakerz/etc/sysconfig/sbd)r6r)rrr7r>r1rr8rrr1�s
zRedHatPacemaker.setupcCs|��dSr:)r rrrrr;�szRedHatPacemaker.postprocr<rrr8rr>�sr>)Zsos.report.pluginsrrrrrrrr&r	r5r>rrrr�<module>	s
t