Server IP : 184.107.3.203 / Your IP : 216.73.216.51 Web Server : Apache System : Linux dedicated2.avenfashion.com.ph 4.18.0-553.40.1.el8_10.x86_64 #1 SMP Mon Feb 10 12:11:18 EST 2025 x86_64 User : adminteladeoro ( 1015) PHP Version : 8.2.28 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /usr/lib/python3.6/site-packages/sos/report/plugins/__pycache__/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
3 ~ �g� � @ s. d dl Z d dlmZmZ G dd� dee�ZdS )� N)�Plugin�IndependentPluginc @ s, e Zd ZdZdZd ZdZdd� Zdd� Zd S )�ElasticzElasticSearch serviceZelastic�services� elasticsearchc C s� d}d}y�t |dd���}x||D ]t}tjd|�}tjd|�}|rnt|j� �dkrn|j� d j� }tjd d |�}q|rt|j� �dkr|j� d j� }qW W dQ R X W n8 tk r� } z| jd|� d |� �� W Y dd}~X nX ||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�lineZnetwork_hostZnetwork_port�err� r �/usr/lib/python3.6/elastic.py�get_hostname_port s "(zElastic.get_hostname_portc C s� | j d�}| j|� | jd�r*| jd� n | jd� | j|�\}}|d | }| jd|� d�d|� d�d|� d �d|� d �d|� d�d|� d�d|� d �g� d S )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_optionr Zadd_cmd_output)r r �hostr Zendpointr r r �setup* s z Elastic.setupN)r )r ) �__name__� __module__�__qualname__Z short_descZplugin_nameZprofilesZpackagesr r r r r r r s r )r Zsos.report.pluginsr r r r r r r �<module> s