HEX
Server: Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System: Linux ns565604.ip-54-39-133.net 4.18.0-553.50.1.el8_10.x86_64 #1 SMP Tue Apr 15 08:09:22 EDT 2025 x86_64
User: greer489 (1034)
PHP: 8.3.19
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/sos/report/plugins/__pycache__/logs.cpython-36.pyc
3

-�_g9�@sXddlZddlmZmZmZmZGdd�de�ZGdd�dee�ZGdd�dee�ZdS)	�N)�Plugin�	PluginOpt�IndependentPlugin�	CosPluginc@s(eZdZdZdZdZdd�Zdd	�Zd
S)�LogsBasezSystem logs�logs�system�hardware�storagec	s�d}d|g}g}�j|�rlt�j|�ddd��8}x0|j�D]$}|jd�r:|tj|j�d�7}q:WWdQRXx8|D]0}�j�j|��s�qr�j|�}|�jd|�7}qrWx6|D].}|jd	�r�|dd�}�j|�r��j	|�q�W�j	dd
ddd
dddddg
��j
d��jddd�t�fdd�d3D��}|�r��j
d��r��jddgdd��jd d!d"��jd#d$d"��jd%��r��j	d&d'g�n:�jd%��s��j	d(d)d*d+d,d-dd.d/g	�n�j	d0d1d2g�dS)4Nzetc/rsyslog.confz/etc/syslog.conf�rzUTF-8)�encodingz$IncludeConfig�z^\S+\s+(-?\/.*$)\s+�-z/etc/rsyslog.confz/etc/rsyslog.dz/var/log/boot.logz/var/log/installerz/var/log/messages*z/var/log/secure*z
/var/log/udevz/var/log/dist-upgradez/var/log/auth.logzjournalctl --disk-usagez/var/logT)�	recursivec3s |]}�j�j|d��VqdS)zlog/journal/N)�path_exists�	path_join)�.0�p)�self��/usr/lib/python3.6/logs.py�	<genexpr>?sz!LogsBase.setup.<locals>.<genexpr>�/var�/runzsystemd-journaldZjournal_fullZjournal_all�d)�tagsZpriority�thisZjournal_since_boot)ZbootrZlastZjournal_last_boot�all_logsz/var/log/journal/*z/run/log/journal/*z/var/log/syslogz/var/log/syslog.1z/var/log/syslog.2*z/var/log/kern.logz/var/log/kern.log.1z/var/log/kern.log.2*z/var/log/auth.log.1z/var/log/auth.log.2*z/var/log/syslog*z/var/log/kern.log*z/var/log/auth.log*)rr)r�openr�	readlines�
startswith�glob�splitZdo_regex_find_allZpath_isfileZ
add_copy_spec�add_cmd_outputZadd_dir_listing�anyZ
is_service�add_journal�
get_option)	rZrsyslogZconfsrZconf�line�config�iZjournalr)rr�setupsr

$









zLogsBase.setupcCs|jddd�dS)Nz
/etc/rsyslog*z (ActionLibdbiPassword |pwd=)(.*)z\1[********])Zdo_path_regex_sub)rrrr�postproc_szLogsBase.postprocN)rr	r
)�__name__�
__module__�__qualname__Z
short_desc�plugin_name�profilesr*r+rrrrr
s
Krc@seZdZdZdZdZdS)�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.
    rrr	r
N)rr	r
)r,r-r.�__doc__r/r0rrrrr1gs
r1cs,eZdZedddd�gZ�fdd�Z�ZS)�CosLogszlog-days�z"the number of days logs to collect)�name�defaultZdesccsDt�j�|jd�r |jd�n |jdd�}|jd|�d�d�dS)Nrzjournalctl -o exportzlog-daysr4r�days)Zsince)�superr*r&r#r%)rr7)�	__class__rrr*}s


z
CosLogs.setup)r,r-r.rZoption_listr*�
__classcell__rr)r9rr3ws
r3)	r!Zsos.report.pluginsrrrrrr1r3rrrr�<module>	sZ