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: //usr/lib/python3.9/site-packages/sos/report/plugins/__pycache__/elastic.cpython-39.pyc
a

^��cB	�@s.ddlmZmZddlZGdd�dee�ZdS)�)�Plugin�IndependentPluginNc@s,eZdZdZdZdZdZdd�Zdd�Zd	S)
�ElasticzElasticSearch serviceZelastic)Zservices)Z
elasticsearchc	
Cs�d}d}z�t|���}|D]t}t�d|�}t�d|�}|rht|���dkrh|��d��}t�dd|�}q|rt|���dkr|��d��}qWd�n1s�0YWn6ty�}z|�d	||f�WYd}~n
d}~00||fS)
NZ	localhostZ9200z(^network.host):(.*)z(^http.port):(.*)����z"|\'�zFailed to parse %s: %s)	�open�re�search�len�groups�strip�sub�	ExceptionZ	_log_info)	�self�els_config_file�hostname�portZfread�lineZnetwork_hostZnetwork_port�e�r�>/usr/lib/python3.9/site-packages/sos/report/plugins/elastic.py�get_hostname_ports 
4(zElastic.get_hostname_portcCsz|�d�}|�|�|�d�r*|�d�n
|�d�|�|�\}}|d|}|�d|d|d|d	|d
|g�dS)Nz$/etc/elasticsearch/elasticsearch.ymlZall_logsz/var/log/elasticsearch/*z(/var/log/elasticsearch/elasticsearch.log�:z)curl -X GET '%s/_cluster/settings?pretty'z'curl -X GET '%s/_cluster/health?pretty'z&curl -X GET '%s/_cluster/stats?pretty'zcurl -X GET '%s/_cat/nodes?v'zcurl -X GET '%s/_cat/indices')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)Zsos.report.pluginsrrr	rrrrr�<module>s