관리-도구
편집 파일: pacemaker.cpython-39.opt-1.pyc
a ����-�_g?����������������������@���sz���d�dl�Z�d�dlmZmZ�d�dlmZmZmZmZmZ�d�dl m Z �G�dd��de�ZG�dd��deee�ZG�d d ��d ee�Z dS�)�����N)�datetime� timedelta)�Plugin�RedHatPlugin�DebianPlugin�UbuntuPlugin� PluginOpt)�sos_parse_versionc�������������������@���sn���e�Zd�ZdZdZdZdZeddedd�ed d dd�gZ dZ d d��Zdd��Zdd��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���r���c�����������������C���s���|���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$���s����zPacemaker.setup_crm_monc�����������������C���s���|���ddg��dS�)z& Get cluster status and configuration z crm status�crm configure showNr���r���r���r���r����setup_crm_shell(���s�����zPacemaker.setup_crm_shellc�����������������C���s����|�j�j�d�}|du�rdS�|��d��|��g�d���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 ���)r���Zpcs_pkgZpcs_versionr���r���r���� setup_pcs/���s���� zPacemaker.setup_pcsc�����������������C���s���|���ddd��dS�)� Clear password r����passw([^\s=]*)=\S+�passw\1=********N�Zdo_cmd_output_subr���r���r���r����postproc_crm_shellF���s �����zPacemaker.postproc_crm_shellc�����������������C���s���|���ddd��dS�)r!���r���r"���r#���Nr$���r���r���r���r����postproc_pcsN���s �����zPacemaker.postproc_pcsc����������� ������C���sr��|���g�d���|�����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*|���|���qW�d�����n1��sd0����Y��d�S�)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)�nameZmaker���z-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\'$)r���r���r���Ztodayr����strftimeZ get_option�re�match�strZ _log_errorZget_cmd_output_pathZ _log_warnr���Ztmp_in_sysrootZpath_isfile�envfile�open�search�group�sub) r���Zcrm_fromZcrm_destZ crm_scrub�pattern�file�lineZlogfileZregexpr���r���r����setupV���sL������ �� ���zPacemaker.setupN)�__name__� __module__�__qualname__Z short_descZplugin_nameZprofilesZpackagesr���r2���Zoption_listr3���r���r���r ���r%���r&���r;���r���r���r���r���r ������s$������r ���c�����������������������s$���e�Zd�Z��fdd�Zdd��Z���ZS�)�DebianPacemakerc��������������������s*���|���d�|�_|�����|�����t������d�S�)Nz/etc/default/pacemaker)� path_joinr3���r���r ����superr;���r����� __class__r���r���r;�������s����zDebianPacemaker.setupc�����������������C���s���|������|�����d�S��N)r%���r&���r���r���r���r����postproc����s����zDebianPacemaker.postproc�r<���r=���r>���r;���rE���� __classcell__r���r���rB���r���r?�������s���r?���c�����������������������s$���e�Zd�Z��fdd�Zdd��Z���ZS�)�RedHatPacemakerc��������������������s,���|���d�|�_|�����|��d��t������d�S�)Nz/etc/sysconfig/pacemakerz/etc/sysconfig/sbd)r@���r3���r ���r���rA���r;���r���rB���r���r���r;�������s���� zRedHatPacemaker.setupc�����������������C���s���|������d�S�rD���)r&���r���r���r���r���rE�������s����zRedHatPacemaker.postprocrF���r���r���rB���r���rH�������s���rH���)r0���r���r���Zsos.report.pluginsr���r���r���r���r���Z sos.utilitiesr ���r ���r?���rH���r���r���r���r����<module> ���s����