%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__/sar.cpython-312.pyc

�

i��d����ddlmZmZmZmZmZddlZddlZddlmZ	Gd�de�Z
Gd�de
e�ZGd�d	e
ee�Zy)
�)�Plugin�RedHatPlugin�DebianPlugin�UbuntuPlugin�	PluginOptN)�datetimec�B�eZdZdZdZdZdZdZdZe	ddd	�
�gZ
d�Zy)
�SaraN
    The sar plugin is designed to collect system performance data as recorded
    by sysstat.

    The raw binary data, i.e. the 'saX' files, will be collected and for files
    a week old or younger, this plugin will capture human-readable conversions
    of those files provided by the 'sar' command locally available, if the
    local sysstat installation has not already created a converted copy (e.g.
    for the current day-of data being collected at the time of report
    generation).

    Using the 'all_sar' plugin option will not only cause the plugin to capture
    _all_ 'saX' files present on the host, but further perform the 'sar'
    conversion on all files, not just those produced within the last week.

    Converted 'sar' files will be written to the sos_commands/sar/, and not
    to the /var/log/ path that sysstat writes to.

    Note that this conversion is done because it is unlikely that the same
    version of sysstat that produces the 'saX' files will be the same version
    available on a given analyst's workstation, and this conversion is version
    sensitive.
    zSystem Activity Reporter�sar)�system�performance)�sysstat�/var/log/sa�all_sarFz"gather all system activity records)�default�descc�Z�|j|j|jd�|jd�rdndd��	|j	|j�}tjd�}|D]�}|j|�s�|j|j|�}d|d	dz}||vr�|jd�s[	tj|�j}tj�tj|�z
}|j d
kDr��	d
|z}	|j%|	|�d|z}
|j%|
d|z���y#t
$r!|j
d|jz�YywxYw#t"$r"}|j
d|�d|���Yd}~��0d}~wwxYw)N�*rrF)�	sizelimit�tailitzsar: could not list %szsa[\d]+r��zCould not determine age of 'z'' - skipping converting to sar format: zsar -A -f %szsadf -x -- -A %sz%s.xml)�
add_copy_spec�	path_join�sa_path�
get_option�listdir�OSError�	_log_warn�re�compile�match�os�stat�st_mtime�dt�today�
fromtimestamp�days�	Exception�add_cmd_output)�self�dir_list�sa_regex�fname�sa_data_path�sar_filename�_ftime�_age�err�sar_cmd�sadf_cmds           �8/usr/lib/python3/dist-packages/sos/report/plugins/sar.py�setupz	Sar.setup5s������4�>�>�$�,�,��<�*.�/�/�)�*D�Q�$�"'�	�	)�	��|�|�D�L�L�1�H��:�:�j�)���	@�E��~�~�e�$�#�~�~�d�l�l�E�B��$�u�Q�R�y�0���x�/��?�?�9�5�%�%'�W�W�\�%:�%C�%C�F�#%�8�8�:��0@�0@��0H�#H�D�#�y�y�1�}� (� -�-�|�;�G��'�'���>�-��<���#�#�H�h��.>�?�-	@���	��N�N�3�d�l�l�B�C��	��* )�%� �N�N�$0��!6��
%��
%�s+�E�AE?�'E<�;E<�?	F*�F%�%F*N)�__name__�
__module__�__qualname__�__doc__�
short_desc�plugin_name�profiles�packagesrr�option_listr8��r7r
r
s>���0,�J��K�(�H��H��G��)�U�;�	=��K�
&@rCr
c��eZdZdZy)�	RedHatSarrN�r9r:r;rrBrCr7rErE^s���GrCrEc��eZdZdZy)�	DebianSarz/var/log/sysstatNrFrBrCr7rHrHcs�� �GrCrH)
�sos.report.pluginsrrrrrr r#rr&r
rErHrBrCr7�<module>rJsG��9�9�	�	�#�K@�&�K@�\��\��
!��\�<�!rC

Zerion Mini Shell 1.0