HEX
Server: Apache
System: Linux dinesh8189 5.15.98-grsec-sharedvalley-2.lc.el8.x86_64 #1 SMP Thu Mar 9 09:07:30 -03 2023 x86_64
User: cgmgerenciamento1 (814285)
PHP: 8.1.26
Disabled: apache_child_terminate,dl,escapeshellarg,escapeshellcmd,exec,link,mail,openlog,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,php_check_syntax,php_strip_whitespace,popen,proc_close,proc_open,shell_exec,symlink,system
Upload Files
File: //usr/lib/python3.6/site-packages/sos/report/plugins/__pycache__/pcp.cpython-36.pyc
3

3��d��@sDddlmZmZmZmZddlZddlmZGdd�deee�ZdS)�)�Plugin�RedHatPlugin�DebianPlugin�	PluginOptN)�gethostnamec@sdeZdZdZdZdZdZdZedddd	�ed
ddd	�gZ	d
Z
d
Zd
ZdZ
dd�Zdd�Zdd�Zd
S)�PcpzPerformance Co-Pilot data�pcp�system�performancez
/etc/pcp.conf�	pmmgrlogs�dzsize limit in MB of pmmgr logs)�defaultZdesc�
pmloggerfiles�z#number of pmlogger files to collectN�cCsLd}xBtj|�D]4\}}}x(|D] }|j||�}|tjj|�7}q WqW|S)Nr)�os�walk�	path_join�path�getsize)�selfrZ
total_size�dirpathZdirnames�	filenames�f�fp�r�/usr/lib/python3.6/pcp.py�get_size(s
zPcp.get_sizecCs�y t|jd�}|j�}|j�Wntk
r4dSXi}xP|D]H}|jd�rPq@y|j�jd�\}}|||<Wq@tt	fk
r�Yq@Xq@Wy"|d|_
|d|_|d|_Wnt
k
r�dSXdS)	N�rF�#�=ZPCP_SYSCONF_DIRZPCP_VAR_DIRZPCP_LOG_DIRT)�open�pcp_conffile�	readlines�close�IOError�
startswith�strip�split�
ValueError�KeyError�pcp_sysconf_dir�pcp_var_dir�pcp_log_dir�	Exception)rZpcpconf�linesZenv_vars�line�key�valuerrr�pcp_parse_conffile0s,




zPcp.pcp_parse_conffilec	Cs|jd�rdn|jd�|_|jd�r(dn|jd�|_|j�sP|jd|j�dS|j|jd�}|j|j	|j|g�|j
|j|d�|j|d�|j|d�|j|d	�g�t�|_|jd
k�rV|j|j
d|jd�}|j||jd
d�d}|j|j
d|jd�}|jd|�}|ddk�rVxB|dj�D]2}|j|dd�|d}|j�r ||jk�r P�q W|j|j|j
d�|j|j
d�|j|jd�|j|j
d�|j|j
d�|j|j
d�g�|jd�}|ddk�rxB|dj�D]2}|jd��r�|j�d!}|jd|dd �P�q�WdS)"NZall_logsrrzcould not parse %s�configZpmchartZ	pmlogconfZpmieconfZpmlogrewriterZpmmgr�*F)�	sizelimitZtailitrZpmloggerz	ls -t1 %sZstatus�output)r6�ZpmcdzNOTICES*Zpmnsz*/*.log*z
*/*/*.log*z*/*/config*rz
 pmlogger:z'pmstat -S 00:00 -T 23:59 -t 5m -x -a %sZpmstat)Zroot_symlink���)Z
get_optionr6Z
countlimitr3Z	_log_warnr"rr,Z
add_copy_specr+Zadd_forbidden_pathr�pcp_hostnamer-Zexec_cmd�
splitlinesZcollect_cmd_outputr&r(Zadd_cmd_output)rZvar_conf_dirrZfiles_collectedZpmlogger_lsr0�resZarcrrr�setupKs`







z	Pcp.setup)r	r
)r)�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofilesZpackagesr"rZoption_listr+r,r-r:rr3r=rrrrrs 
r)	Zsos.report.pluginsrrrrrZsocketrrrrrr�<module>s