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

3��d[�@sjddlZddlmZmZmZmZmZddlmZGdd�de�Z	Gdd�de	e�Z
Gdd	�d	e	ee�ZdS)
�N)�Plugin�UbuntuPlugin�DebianPlugin�	SCLPlugin�	PluginOpt)�findc@s�eZdZdZdZdZdZdZedddd	�ed
de	dd
�edde	ded
�edde	dd
�edde	dd
�edde
dd
�gZd dd�Zdd�Z
dS)!�
PostgreSQLzPostgreSQL RDBMS�
postgresql�services�postgresql-commonz' (password visible in process listings)�pghomez/var/lib/pgsqlzpsql server home directory)�default�desc�usernameZpostgreszusername for pg_dump)r
Zval_typer�password�zpassword for pg_dump�dbnamez"database name to dump with pg_dump�dbhostz.database hostname/IP address (no unix sockets)�dbporti8zdatabase server listening portN�
pgdump.tarcCs�|jd�r�|jd�sdtjkr�|jd�r8|jd�tjd<|jd�rld|jd�|jd�|jd�|jd�f}nd|jd�|jd�f}|dk	r�|j||�}|j||d	d
d�n|jjd�|jd
�dS)NrrZ
PGPASSWORDrz$pg_dump -U %s -h %s -p %s -w -F t %srrzpg_dump -C -U %s -w -F t %s Tr)Zsuggest_filenameZbinaryZ	sizelimitz-password must be supplied to dump a database.z3WARN: password must be supplied to dump a database.)�
get_option�os�environZconvert_cmd_scl�add_cmd_outputZsoslogZwarningZ	add_alert)�self�scl�filename�cmd�r� /usr/lib/python3.6/postgresql.py�
do_pg_dump0s*


zPostgreSQL.do_pg_dumpcCs |j�|jd|jd��dS)Nz	du -sh %sr)r rr)rrrr�setupSszPostgreSQL.setup)r
)r	r)Nr)�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofiles�packagesZpassword_warn_textr�str�intZoption_listr r!rrrrrs&


#rcs eZdZdZ�fdd�Z�ZS)�RedHatPostgreSQLr	�!rh-postgresql95-postgresql-server�!rh-postgresql10-postgresql-server�!rh-postgresql12-postgresql-servercstt|�j�|jd�}|g}x�|jdd�D]n}|jd�d}|j||�}|j|�|j|�rn|j	d|�|j
|jdd��r.||jkr.|j
|d|d	�q.Wxj|D]b}xtd
|�D]}|j|�q�Wxtd|�D]}|j|�q�Wx dD]}|j|j|d|��q�Wq�WdS)Nr�z-postgresql-rz	du -sh %sz-serverrzpgdump-scl-%s.tar)rrz*.logz*.conf�
PG_VERSION�postmaster.opts�data)r-r.)�superr(r!rr%�splitZconvert_copyspec_scl�appendZ
path_isdirrZis_service_running�replaceZscls_matchedr r�
add_copy_specZ	path_join)rr�dirsZpkgrZ_dirr�f)�	__class__rrr!as&





zRedHatPostgreSQL.setup)r	r)r*r+)r"r#r$r%r!�
__classcell__rr)r7rr(Xs
r(cseZdZ�fdd�Z�ZS)�DebianPostgreSQLcs$tt|�j�|jddddg�dS)Nz/var/log/postgresql/*.logz/etc/postgresql/*/main/*.confz%/var/lib/postgresql/*/main/PG_VERSIONz*/var/lib/postgresql/*/main/postmaster.opts)r0r9r!r4)r)r7rrr!�szDebianPostgreSQL.setup)r"r#r$r!r8rr)r7rr9�sr9)rZsos.report.pluginsrrrrrZ
sos.utilitiesrrr(r9rrrr�<module>s
B*