HEX
Server: Apache
System: Linux insrv.serversdaddy.com 5.14.0-362.24.2.el9_3.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Mar 30 14:11:54 EDT 2024 x86_64
User: jsaha (1066)
PHP: 8.3.6
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3.9/site-packages/sos/report/plugins/__pycache__/pacemaker.cpython-39.opt-1.pyc
a

^��c*�@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.9/site-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_shellcCsF|�d�|�gd��|jddd�|jddd�|jdd	d�dS)
Nz/var/log/pcsd/pcsd.log)zpcs stonith sbd status --fullzpcs stonith sbd watchdog listzpcs stonith history showzpcs property list --all�
pcs configZ
pcs_config)�tagszpcs 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	CsZ|�gd��|��t��tdd��d�}|�d�rnt�dt	|�d���rZ|�d�}n|�
d|�d��|jdd	d
�}|�d�r�d}nd
}|�d�|�d�|j
d|||f|��d�d}|�|j��rV|�|j�t|j��\}|D]F}t�||�r�t�||��d�}dD]}t�|d
|�}�q|�|�q�Wd�n1�sL0YdS)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:%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�setupFsL��
���


��zPacemaker.setupN)�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofilesZpackagesrr*Zoption_listr+rrrr r!r3rrrrr	s$���r	cs$eZdZ�fdd�Zdd�Z�ZS)�DebianPacemakercs.|�d�|_|��|��tt|���dS)Nz/etc/default/pacemaker)�	path_joinr+rr�superr7r3r��	__class__rrr3�szDebianPacemaker.setupcCs|��|��dS�N)r r!rrrr�postproc�szDebianPacemaker.postproc�r4r5r6r3r=�
__classcell__rrr:rr7�sr7cs$eZdZ�fdd�Zdd�Z�ZS)�RedHatPacemakercs0|�d�|_|��|�d�tt|���dS)Nz/etc/sysconfig/pacemakerz/etc/sysconfig/sbd)r8r+rrr9r@r3rr:rrr3�s
zRedHatPacemaker.setupcCs|��dSr<)r!rrrrr=�szRedHatPacemaker.postprocr>rrr:rr@�sr@)Zsos.report.pluginsrrrrrrrr(r	r7r@rrrr�<module>	s
t