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__/coredump.cpython-36.pyc
3

��Zh��@s:ddlZddlZddlmZmZmZGdd�dee�ZdS)�N)�Plugin�IndependentPlugin�	PluginOptc@sDeZdZdZdZdZdZdZedd	d
d�edd
dd�gZ	dd�Z
dS)�Coredumpaa
    This plugin collects from the systemd-coredump service, which is leveraged
    via the coredumpctl command.

    Beyond basic configuration of the service, the plugin will also attempt to
    collect information on available coredumps. For any coredumps reported by
    coredumpctl for which the core is present, this plugin will collect that
    coredump file. The number of dump files collects is controlled by the
    `dumps` option, defaulting to 3. Note that core collection is performed
    based on the most recent cores generated. The summary information provided
    by `coredumpctl info` is also collected.

    The coredump files will be at their canonical location in the sos archive,
    usually under var/lib/systemd/coredump. Symlinks are dropped in the plugin
    directory to assist in identifying which coredump aligns to which entry in
    the provided `coredumpctl list` output collection.

    Users may leverage the `executable` option to control which coredumps the
    plugin will collect. This option takes a case-insensitive python regex
    string. If provided, only coredump entries for which the EXE field in
    `coredumpctl list` output matches will be collected.

    The dump files collected are compressed, and users should be aware that
    when inflated these files can be orders of magnitude larger than their
    collected sizes.
    z3systemd-coredump related information and dump filesZcoredump�system�debug�systemd-udev�systemd-coredump�dumps�znumber of dump files to collect)�defaultZdesc�
executable�zEonly collect info and dump output for executables matching this regexcCs�|jdddddg�|jd�}|ddkr.dSd}�x�|d	j�d
d�D�]�}|j�}|d}|d}|jd
�r�tj|jd
�|tj�s�qJ|jd|���}|ddkr�qJ|d	}||jd�krJtjd|tj�}	y�|	j	�d
j
�}
tj|
�j
dk�r|jd|
�d��wJ|j|
ddd�|j|jd|j�d|�d|j|����}tjj|jj�|
�}tjj||�}
|
jddd
�}
|jj|
|�|d
7}WqJtk
�r�YqJtk
�r�}z|jd|�d|���WYdd}~XqJXqJWdS)Nz/etc/systemd/coredump.confz/etc/systemd/coredump.conf.d/z/run/systemd/coredump.conf.d/z!/usr/lib/systemd/coredump.conf.d/z!/usr/lib/systemd/systemd-coredumpzcoredumpctl list --reverseZstatusr�output���r
zcoredumpctl info r
z(^\s*Storage:(.*)(\(present\)))i�zSkipping core dump file z due to sizeF��)ZtailitZ	sizelimitZcmddirZ	coredump_�_z../rzCould not collect coredump for z : ���)Z
add_copy_specZcollect_cmd_output�
splitlines�splitZ
get_option�re�search�I�M�groups�strip�os�stat�st_sizeZ	_log_infoZ	path_joinZcommons�nameZ_mangle_command�path�join�archiveZget_archive_path�relpath�replaceZadd_link�AttributeError�	Exception)�selfZ
coredump_listZcores_collected�lineZcdump�pidZexeZcinfo�resZcoreZ	core_pathZplugpathZarcpathZlinkpath�err�r.�/usr/lib/python3.6/coredump.py�setup9sZ

zCoredump.setupN)rr)rr	)�__name__�
__module__�__qualname__�__doc__Z
short_descZplugin_nameZprofilesZpackagesrZoption_listr0r.r.r.r/rs
r)rrZsos.report.pluginsrrrrr.r.r.r/�<module>s

NineSec Team - 2022