%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/sos/report/plugins/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/sos/report/plugins/__pycache__/pcp.cpython-312.pyc

�

i��d���J�ddlmZmZmZmZddlZddlmZGd�deee�Zy)�)�Plugin�RedHatPlugin�DebianPlugin�	PluginOptN)�gethostnamec�n�eZdZdZdZdZdZdZeddd�	�ed
dd�	�gZ	d
Z
d
Zd
ZdZ
d�Zd�Zd�Zy
)�PcpzPerformance Co-Pilot data�pcp)�system�performance)r
z
/etc/pcp.conf�	pmmgrlogs�dzsize limit in MB of pmmgr logs)�default�desc�
pmloggerfiles�z#number of pmlogger files to collectN�c��d}tj|�D]A\}}}|D]6}|j||�}|tjj	|�z
}�8�C|S)Nr)�os�walk�	path_join�path�getsize)�selfr�
total_size�dirpath�dirnames�	filenames�f�fps        �8/usr/lib/python3/dist-packages/sos/report/plugins/pcp.py�get_sizezPcp.get_size(sc���
�,.�G�G�D�M�	2�(�G�X�y��
2���^�^�G�Q�/���b�g�g�o�o�b�1�1�
�
2�	2���c��	t|jd�}|j�}|j�i}|D]<}|jd�r�	|j
�jd�\}}|||<�>	|d|_
|d|_|d|_y#t$rYywxYw#ttf$rY�wxYw#t$rYywxYw)	N�rF�#�=�PCP_SYSCONF_DIR�PCP_VAR_DIR�PCP_LOG_DIRT)�open�pcp_conffile�	readlines�close�IOError�
startswith�strip�split�
ValueError�KeyError�pcp_sysconf_dir�pcp_var_dir�pcp_log_dir�	Exception)r�pcpconf�lines�env_vars�line�key�values       r!�pcp_parse_conffilezPcp.pcp_parse_conffile0s���	��4�,�,�c�2�G��%�%�'�E��M�M�O����	�D����s�#��
�#�z�z�|�1�1�#�6���e� %���
�	�	�#+�,=�#>�D� �'�
�6�D��'�
�6�D��
��)�	��	����)�
��
���	��	�s5�6B�'B*�<B?�	B'�&B'�*B<�;B<�?	C�
Cc�j�|jd�rdn|jd�|_|jd�rdn|jd�|_|j�s|j	d|j
z�y|j
|jd�}|j|j|j
|g�|j|j
|d�|j
|d�|j
|d�|j
|d	�g�t�|_|jd
k7r�|j
|jd|jd�}|j||jd
��d}|j
|jd|jd�}|jd|z�}|ddk(rN|dj�D]8}|j|d��|dz}|js�(||jk(s�8n|j|j
|jd�|j
|jd�|j
|jd�|j
|jd�|j
|jd�|j
|jd�g�|j!d�}|ddk(rU|dj�D]>}|j#d�s�|j%�d}|j'd|zd �!�yyy)"N�all_logsr
rzcould not parse %s�config�pmchart�	pmlogconf�pmieconf�pmlogrewriter�pmmgr�*F)�	sizelimit�tailitr�pmloggerz	ls -t1 %s�status�output)rI��pmcdzNOTICES*�pmnsz*/*.log*z
*/*/*.log*z*/*/config*r
z
 pmlogger:���z'pmstat -S 00:00 -T 23:59 -t 5m -x -a %s�pmstat)�root_symlink)�
get_optionrI�
countlimitr?�	_log_warnr,rr6�
add_copy_specr5�add_forbidden_pathr�pcp_hostnamer7�exec_cmd�
splitlines�collect_cmd_outputr0r2�add_cmd_output)r�var_conf_dirr�files_collected�pmlogger_lsr<�res�arcs        r!�setupz	Pcp.setupKs���"&�/�/�*�"=�$�#���{�;�	
��#'�?�?�:�#>�4� $���� @�	
���&�&�(��N�N�/�$�2C�2C�C�D���~�~�d�&6�&6��A������ � �����
�	�	
����N�N�<��3��N�N�<��5��N�N�<��4��N�N�<��8�	!
�	�$(�M�������"��>�>�$�"2�"2�G�"&�"3�"3�S�:�D����t�t�~�~�e��L��O��>�>�$�"2�"2�J�"&�"3�"3�S�:�D��-�-��d�(:�;�K��8�$��)�'��1�<�<�>��D��&�&�t�q�&�9�&5��&9�O����?�d�o�o�+M��	�	
����N�N�4�+�+�V�4��N�N�4�+�+�Z�8��N�N�4�+�+�V�4�
�N�N�4�+�+�Z�8��N�N�4�+�+�\�:��N�N�4�+�+�]�;�
�	��%�%�e�,���x�=�A���H�
�0�0�2�
���?�?�<�0��*�*�,�r�*�C��'�'�A�C�G�%-�(���
�r#)�__name__�
__module__�__qualname__�
short_desc�plugin_name�profiles�packagesr,r�option_listr5r6r7rYr"r?rc�r#r!r	r	sh��,�J��K�(�H��H�"�L�	�+�s�7�	9��/�2�<�	>��K��O��K��K��L���6Wr#r	)	�sos.report.pluginsrrrrr�socketrr	rlr#r!�<module>ros&��M�L�	��R�&�,��Rr#

Zerion Mini Shell 1.0