NineSec Team Shell
Server IP : 184.107.3.203  /  Your IP : 216.73.216.51
Web Server : Apache
System : Linux dedicated2.avenfashion.com.ph 4.18.0-553.40.1.el8_10.x86_64 #1 SMP Mon Feb 10 12:11:18 EST 2025 x86_64
User : adminteladeoro ( 1015)
PHP Version : 8.2.28
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /usr/lib/python3.6/site-packages/sos/report/plugins/__pycache__/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //usr/lib/python3.6/site-packages/sos/report/plugins/__pycache__/pacemaker.cpython-36.opt-1.pyc
3

~�g?�@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�cluster�pacemaker-remotezcrm-from�z%specfiy the start time for crm_report)�defaultZval_type�descz	crm-scrubTz$enable crm_report password scrubbing)rrcCs|jd�dS)z Get cluster summary zcrm_mon -1 -A -n -r -tN)�add_cmd_output)�self�r�/usr/lib/python3.6/pacemaker.py�
setup_crm_mon$szPacemaker.setup_crm_moncCs|jddg�dS)z& Get cluster status and configuration z
crm statuszcrm configure showN)r)rrrr�setup_crm_shell(szPacemaker.setup_crm_shellcCs�|jjjd�}|dkrdS|jd�|jdddg�dj|d�}t|�td	�kr^|jd
�n
|jd�|jdd
d�|jddd�|jddd�dS)z& Get pacemaker/corosync configuration ZpcsNz/var/log/pcsd/pcsd.logzpcs stonith sbd status --fullzpcs stonith sbd watchdog listzpcs stonith history show�.�versionz0.10.8zpcs property config --allzpcs property list --allz
pcs configZ
pcs_config)Ztagszpcs 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|jddd�dS)z Clear password zcrm configure showzpassw([^\s=]*)=\S+zpassw\1=********N)�do_cmd_output_sub)rrrr�postproc_crm_shellFszPacemaker.postproc_crm_shellcCs|jddd�dS)z Clear password z
pcs configzpassw([^\s=]*)=\S+zpassw\1=********N)r)rrrr�postproc_pcsNszPacemaker.postproc_pcsc	
Csn|jdddddddg�|j�tj�tdd�jd	�}|jd
�r|tjdt	|jd
���rd|jd
�}n|j
d|jd
��d
��|jddd�}|jd�r�d}nd}|jd�|jd�|j
d|�d|�d|�d�|j�d�d}|j|j��rj|j|j�t|jddd��^}xV|D]N}tj||��rtj||�jd�}xd$D]}tj|d|�}�q8W|j|��qWWdQRXdS)%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:%Szcrm-fromz#\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)�nameZmakez	crm-scrubz-p "passw.*"rz-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��^"�"$�^\'�\'$)r&r'r(r))rrrZtodayrZstrftimeZ
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�setupVsF





zPacemaker.setupN)r)rr
)�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofilesZpackagesrr,Zoption_listr-rrrrrr5rrrrr
s 
r
cs$eZdZ�fdd�Zdd�Z�ZS)�DebianPacemakercs*|jd�|_|j�|j�t�j�dS)Nz/etc/default/pacemaker)�	path_joinr-rr�superr5)r)�	__class__rrr5�szDebianPacemaker.setupcCs|j�|j�dS)N)rr)rrrr�postproc�szDebianPacemaker.postproc)r6r7r8r5r=�
__classcell__rr)r<rr9�sr9cs$eZdZ�fdd�Zdd�Z�ZS)�RedHatPacemakercs,|jd�|_|j�|jd�t�j�dS)Nz/etc/sysconfig/pacemakerz/etc/sysconfig/sbd)r:r-rrr;r5)r)r<rrr5�s
zRedHatPacemaker.setupcCs|j�dS)N)r)rrrrr=�szRedHatPacemaker.postproc)r6r7r8r5r=r>rr)r<rr?�sr?)r*rrZsos.report.pluginsrrrrrZ
sos.utilitiesr	r
r9r?rrrr�<module>	s

NineSec Team - 2022