HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //lib/python3.6/site-packages/sos/report/plugins/__pycache__/elastic.cpython-36.opt-1.pyc
3

\��h�	�@s.ddlZddlmZmZGdd�dee�ZdS)�N)�Plugin�IndependentPluginc@s,eZdZdZdZd
ZdZdd�Zdd�Zd	S)�ElasticzElasticSearch serviceZelastic�services�
elasticsearchc	Cs�d}d}y�t|dd���}x||D]t}tjd|�}tjd|�}|rnt|j��dkrn|j�dj�}tjd	d
|�}q|rt|j��dkr|j�dj�}qWWdQRXWn8tk
r�}z|jd|�d
|���WYdd}~XnX||fS)z Get hostname and port number Z	localhostZ9200zUTF-8)�encodingz(^network.host):(.*)z(^http.port):(.*)��z"|\'�NzFailed to parse z: ���r)	�open�re�search�len�groups�strip�sub�	ExceptionZ	_log_info)	�self�els_config_fileZhostname�portZfread�lineZnetwork_hostZnetwork_port�err�r�/usr/lib/python3.6/elastic.py�get_hostname_ports 
"(zElastic.get_hostname_portc
Cs�|jd�}|j|�|jd�r*|jd�n
|jd�|j|�\}}|d|}|jd|�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)r)r)	�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofilesZpackagesrrrrrrrsr)r
Zsos.report.pluginsrrrrrrr�<module>s