Current File : //proc/353637/cwd/lib/python3/dist-packages/sos/report/plugins/__pycache__/logs.cpython-312.pyc |
�
C��g� � �j � d dl Z d dlmZmZmZmZ G d� de� Z G d� dee� Z G d� dee� Zy) � N)�Plugin� PluginOpt�IndependentPlugin� CosPluginc �$ � e Zd ZdZdZdZd� Zd� Zy)�LogsBasezSystem logs�logs��system�hardware�storagec �� � � d}d|g}g }� j |� rwt � j |� dd�� 5 }|j � D ]= }|j d� s�|t j
|j
� d � z
}�? d d d � |D ]I }� j � j |� � s�$� j |� }|� j d|� z
}�K |D ]; }|j d � r|dd }� j |� s�+� j |� �= � j g d
�� � j d� � j dd
�� t � fd�dD � � }|rs� j d� ra� j ddgd�� � j dd�� � j dd�� � j d� r� j ddg� y y y y # 1 sw Y ��YxY w)Nzetc/rsyslog.conf�/etc/syslog.conf�rzUTF-8)�encodingz$IncludeConfig� z^\S+\s+(-?\/.*$)\s+�-)z/var/log/auth.log*z/var/log/boot.logz/var/log/dist-upgradez/var/log/installerz/var/log/kern.log*z/var/log/messages*z/var/log/secure*z/var/log/syslog*z
/var/log/udevz/etc/rsyslog.confz/etc/rsyslog.dr zjournalctl --disk-usagez/var/logT)� recursivec 3 �` �K � | ]% }�j �j |d � � �� �' y�w)zlog/journal/N)�path_exists� path_join)�.0�p�selfs ��9/usr/lib/python3/dist-packages/sos/report/plugins/logs.py� <genexpr>z!LogsBase.setup.<locals>.<genexpr>A s/ �� �� � 1�� �&�&�t�~�~�a��'H�I� 1�s �+.)z/varz/runzsystemd-journald�journal_full�journal_all�d )�tags�priority�this�journal_since_boot)�bootr �last�journal_last_boot�all_logsz/var/log/journal/*z/run/log/journal/*)r �openr � readlines�
startswith�glob�split�do_regex_find_all�path_isfile�
add_copy_spec�add_cmd_output�add_dir_listing�any�
is_service�add_journal�
get_option) r �rsyslog�confsr �conf�line�config�i�journals ` r �setupzLogsBase.setup s �� �$��#�W�-�������G�$��d�n�n�W�-�s�W�E�
<�� �N�N�,� <�D����'7�8�����4�:�:�<��?�!;�;��<�
<�
� K�D��#�#�D�N�N�4�$8�9���^�^�D�)�F��D�*�*�+A�6�J�J�D� K� � &�A��|�|�C� ��a�b�E������"��"�"�1�%� &�
���
�
�
���5�6����Z�4��8� � 1�/�1� 1���t���'9�:����>�=�"A�&)�
�
+����&�/C��D����&�/B��C����z�*��"�"�(�(�$� � +� ;�7�S
<�
<�s �%G!�+G!�!G+c �* � | j ddd� y )Nz
/etc/rsyslog*z (ActionLibdbiPassword |pwd=)(.*)z\1[********])�do_path_regex_sub)r s r �postproczLogsBase.postprocN s � �����/��
� N)�__name__�
__module__�__qualname__�
short_desc�plugin_name�profilesr= r@ � rA r r r
s � ��J��K�0�H�8�t
rA r c � � e Zd ZdZdZdZy)�IndependentLogsa�
This plugin will collect logs traditionally considered to be "system" logs,
meaning those such as /var/log/messages, rsyslog, and journals that are
not limited to unit-specific entries.
Note that the --since option will apply to journal collections by this
plugin as well as the typical application to log files. Most users can
expect typical journal collections to include the "full" journal, as well
as journals limited to this boot and the previous boot.
r r
N)rB rC rD �__doc__rF rG rH rA r rJ rJ V s � � � �K�0�HrA rJ c �6 � � e Zd Z eddd�� gZ� fd�Z� xZS )�CosLogs�log-days� z"the number of days logs to collect)�name�default�descc � �� t �| � � | j d� r| j d� y | j dd� }| j d|� d��� y )Nr'