HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib/python3/dist-packages/sos/report/plugins/__pycache__/logs.cpython-38.pyc
U

i��d��@sXddlZddlmZmZmZmZGdd�de�ZGdd�dee�ZGdd�dee�ZdS)	�N)�Plugin�	PluginOpt�IndependentPlugin�	CosPluginc@s(eZdZdZdZdZdd�Zdd�ZdS)	�LogsBasezSystem logs�logs��systemZhardwareZstoragec	s�ddg}g}��d�}��d�rjt��d�d��4}|��D]$}|�d�r:|t�|��d�7}q:W5QRX|D]0}����|��s�qn��|�}|��d|�7}qn|D].}|�d�r�|dd�}��	|�r���
|�q���
ddd	d
ddd
ddg	���d���d�t�fdd�dD��}|�r|��
d��r|�j|ddgdd��jd|dd��jd|dd���d��r���
d d!g�n:��d��s���
d"d#d$d%d&d'd(d)d*g	�n��
d+d,d-g�dS).Nz/etc/syslog.confz/etc/rsyslog.conf�since�rz$IncludeConfig�z^\S+\s+(-?\/.*$)\s+�-z/etc/rsyslog.dz/var/log/boot.logz/var/log/installerz/var/log/messages*z/var/log/secure*z
/var/log/udevz/var/log/dist-upgradezjournalctl --disk-usagezls -alRh /var/log/csg|]}����|d���qS)zlog/journal/)�path_exists�	path_join)�.0�p��self��9/usr/lib/python3/dist-packages/sos/report/plugins/logs.py�
<listcomp>?s�z"LogsBase.setup.<locals>.<listcomp>)z/varz/runzsystemd-journaldZjournal_fullZjournal_all�d)r
�tagsZpriority�thisZjournal_since_boot)Zbootr
rZlastZjournal_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.logz/var/log/auth.log.1z/var/log/auth.log.2*z/var/log/syslog*z/var/log/kern.log*z/var/log/auth.log*)�
get_optionr�openr�	readlines�
startswith�glob�splitZdo_regex_find_allZpath_isfileZ
add_copy_spec�add_cmd_output�anyZ
is_service�add_journal)	rZconfsrr
�conf�lineZconfig�iZjournalrrr�setups�


"


�

�������zLogsBase.setupcCs|�ddd�dS)Nz
/etc/rsyslog*z (ActionLibdbiPassword |pwd=)(.*)z\1[********])Zdo_path_regex_subrrrr�postprocas
�zLogsBase.postprocN)�__name__�
__module__�__qualname__Z
short_desc�plugin_name�profilesr'r(rrrrr
s
Mrc@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.
    rrN)r)r*r+�__doc__r,r-rrrrr.isr.cs,eZdZedddd�gZ�fdd�Z�ZS)�CosLogs�log_days�z"the number of days logs to collect)�name�defaultZdesccsDtt|���|�d�r$|�d�n|�dd�}|jd|d�dS)Nrzjournalctl -o exportr1r2z-%ddays)r
)�superr0r'rr!r#)rZdays��	__class__rrr's

z
CosLogs.setup)r)r*r+rZoption_listr'�
__classcell__rrr6rr0ys
��r0)	rZsos.report.pluginsrrrrrr.r0rrrr�<module>	s\