%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3.9/site-packages/sos/report/plugins/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3.9/site-packages/sos/report/plugins/__pycache__/postgresql.cpython-39.opt-1.pyc

a

\��hu�@sjddlZddlmZmZmZmZmZddlmZGdd�de�Z	Gdd�de	e�Z
Gdd	�d	e	ee�ZdS)
�N)�Plugin�UbuntuPlugin�DebianPlugin�RedHatPlugin�	PluginOpt)�findc@s�eZdZdZdZdZdZdZedddd	�ed
de	dd
�edde	ded
�edde	dd
�edde	dd
�edde
dd
�gZddd�Zdd�Z
dS)�
PostgreSQLzPostgreSQL RDBMS�
postgresql)Zservices)r	zpostgresql-commonz' (password visible in process listings)�pghomez/var/lib/pgsqlzpsql server home directory)�default�desc�usernameZpostgreszusername for pg_dump)rZval_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 port�
pgdump.tarc
Cs�|�d�r�|�d�sdtjvr�|�d�r8|�d�tjd<|�d�rxd|�d��d|�d��d|�d	��d
|�d���}nd|�d��d
|�d���}|j||dd
d�n|j�d�|�d�dS)z- Extract PostgreSQL database into a tar file rrZ
PGPASSWORDrzpg_dump -U r
z -h z -p rz	 -w -F t zpg_dump -C -U Tr)Zsuggest_filenameZbinaryZ	sizelimitz-password must be supplied to dump a database.z3WARN: password must be supplied to dump a database.N)�
get_option�os�environ�add_cmd_outputZsoslogZwarningZ	add_alert)�self�filename�cmd�r�A/usr/lib/python3.9/site-packages/sos/report/plugins/postgresql.py�
do_pg_dump0s0


�������zPostgreSQL.do_pg_dumpcCs"|��|�d|�d����dS)Nzdu -sh r
)rrr�rrrr�setupNszPostgreSQL.setupN)r)�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofilesZpackagesZpassword_warn_textr�str�intZoption_listrrrrrrrs4�������
rcseZdZ�fdd�Z�ZS)�RedHatPostgreSQLc	szt���|�d�}|g}|D]V}td|�D]}|�|�q,td|�D]}|�|�qFdD]}|�|�|d|��qZqdS)Nr
z*.logz*.conf)Z
PG_VERSIONzpostmaster.opts�data)�superrrr�
add_copy_specZ	path_join)rr
�dirsZ_dirr�file��	__class__rrrUs

zRedHatPostgreSQL.setup�r r!r"r�
__classcell__rrr+rr%Ssr%cseZdZ�fdd�Z�ZS)�DebianPostgreSQLcst���|�gd��dS)N)z/var/log/postgresql/*.logz/etc/postgresql/*/main/*.confz%/var/lib/postgresql/*/main/PG_VERSIONz*/var/lib/postgresql/*/main/postmaster.opts)r'rr(rr+rrrks
zDebianPostgreSQL.setupr-rrr+rr/isr/)rZsos.report.pluginsrrrrrZ
sos.utilitiesrrr%r/rrrr�<module>s
=

Zerion Mini Shell 1.0