HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.60.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 5 05:00:59 EST 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //lib/python3.9/site-packages/sos/report/plugins/__pycache__/elastic.cpython-39.opt-1.pyc
a

\��h�	�@s.ddlZddlmZmZGdd�dee�ZdS)�N)�Plugin�IndependentPluginc@s,eZdZdZdZdZdZdd�Zdd�Zd	S)
�ElasticzElasticSearch serviceZelastic)Zservices)Z
elasticsearchc	
Cs�d}d}z�t|dd���}|D]t}t�d|�}t�d|�}|rlt|���dkrl|��d��}t�d	d
|�}q|rt|���dkr|��d��}qWd�n1s�0YWn:ty�}z"|�d|�d
|���WYd}~n
d}~00||fS)z Get hostname and port number Z	localhostZ9200zUTF-8)�encodingz(^network.host):(.*)z(^http.port):(.*)����z"|\'�NzFailed to parse z: )	�open�re�search�len�groups�strip�sub�	ExceptionZ	_log_info)	�self�els_config_file�hostname�portZfread�lineZnetwork_hostZnetwork_port�err�r�>/usr/lib/python3.9/site-packages/sos/report/plugins/elastic.py�get_hostname_ports 4,zElastic.get_hostname_portcCs�|�d�}|�|�|�d�r*|�d�n
|�d�|�|�\}}|d|}|�d|�d�d|�d�d|�d	�d|�d
�d|�d�d|�d�d|�d
�g�dS)Nz$/etc/elasticsearch/elasticsearch.ymlZall_logsz/var/log/elasticsearch/*z/var/log/elasticsearch/*.log�:z
curl -X GET 'z/_cluster/settings?pretty'z/_cluster/health?pretty'z/_cluster/stats?pretty'z/_cat/nodes?v'z/_cat/indices'z
/_cat/shards'z/_cat/aliases')Z	path_joinZ
add_copy_specZ
get_optionrZadd_cmd_output)rr�hostrZendpointrrr�setup*s$�









�z
Elastic.setupN)	�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofilesZpackagesrrrrrrrsr)r
Zsos.report.pluginsrrrrrrr�<module>s