NineSec Team Shell
Server IP : 184.107.3.203  /  Your IP : 216.73.216.51
Web Server : Apache
System : Linux dedicated2.avenfashion.com.ph 4.18.0-553.40.1.el8_10.x86_64 #1 SMP Mon Feb 10 12:11:18 EST 2025 x86_64
User : adminteladeoro ( 1015)
PHP Version : 8.2.28
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /usr/lib/python3.6/site-packages/sos/report/plugins/__pycache__/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //usr/lib/python3.6/site-packages/sos/report/plugins/__pycache__/logs.cpython-36.pyc
3

~�g��@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	d
ddd
ddddddddg��j
d��jddd�t�fdd�d*D��}|�r��j
d��r��jddgd d!��jd"d#d$��jd%d&d$��jd'��r��j	d(d)g�dS)+Nzetc/rsyslog.confz/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.dzjournalctl --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>Asz!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/*)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�setupsX

$







zLogsBase.setupcCs|jddd�dS)Nz
/etc/rsyslog*z (ActionLibdbiPassword |pwd=)(.*)z\1[********])Zdo_path_regex_sub)rrrr�postprocNszLogsBase.postprocN)rr	r
)�__name__�
__module__�__qualname__Z
short_desc�plugin_name�profilesr*r+rrrrr
s
:rc@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/r0rrrrr1Vs
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*ls


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

NineSec Team - 2022