![]() Server : Apache/2.4.52 (Ubuntu) System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64 User : www-data ( 33) PHP Version : 8.1.2-1ubuntu2.21 Disable Function : NONE Directory : /lib/python3/dist-packages/sos/report/plugins/__pycache__/ |
o i��d� � @ s. d dl mZmZ d dlZG dd� dee�ZdS )� )�Plugin�IndependentPluginNc @ s, e Zd ZdZdZdZdZdd� Zdd� Zd S ) �ElasticzElasticSearch service�elastic)�services)� elasticsearchc C s� d}d}z[t |��E}|D ]:}t�d|�}t�d|�}|r4t|�� �dkr4|�� d �� }t�dd|�}q|rFt|�� �dkrF|�� d �� }qW d � n 1 sQw Y W ||fS W ||fS ty} } z| �d ||f � W Y d }~||fS d }~ww ) N� localhost�9200z(^network.host):(.*)z(^http.port):(.*)� ���z"|\'� zFailed to parse %s: %s) �open�re�search�len�groups�strip�sub� Exception� _log_info) �self�els_config_file�hostname�port�fread�line�network_host�network_port�e� r �</usr/lib/python3/dist-packages/sos/report/plugins/elastic.py�get_hostname_port s0 �������zElastic.get_hostname_portc C s� | � d�}| �|� | �d�r| �d� n| �d� | �|�\}}|d | }| �d| d| d| d | d | d| d| g� d S ) Nz$/etc/elasticsearch/elasticsearch.yml�all_logsz/var/log/elasticsearch/*z/var/log/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'zcurl -X GET '%s/_cat/shards'zcurl -X GET '%s/_cat/aliases')� path_join� add_copy_spec� get_optionr! �add_cmd_output)r r �hostr �endpointr r r �setup) s$ � �z Elastic.setupN) �__name__� __module__�__qualname__� short_desc�plugin_name�profiles�packagesr! r* r r r r r s r )�sos.report.pluginsr r r r r r r r �<module> s