Server IP : 209.38.156.173 / Your IP : 216.73.216.122 [ 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/report/plugins/__pycache__/ |
Upload File : |
o ���b � @ 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 st | � d�}| �|� | �d�r| �d� n| �d� | �|�\}}|d | }| �d| d| d| d | g� d S ) Nz$/etc/elasticsearch/elasticsearch.yml�all_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')� 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