Sindbad~EG File Manager

Current Path : /lib/python3.6/site-packages/sos/report/plugins/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/sos/report/plugins/__pycache__/postgresql.cpython-36.opt-1.pyc

3

�f��@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
�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 port�
pgdump.tarcCs�|jd�r�|jd�sdtjkr�|jd�r8|jd�tjd<|jd�rld|jd�|jd�|jd�|jd�f}nd|jd�|jd�f}|j||d	d
d�n|jjd�|jd
�dS)z- Extract PostgreSQL database into a tar file rrZ
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.N)�
get_option�os�environ�add_cmd_outputZsoslogZwarningZ	add_alert)�self�filename�cmd�r� /usr/lib/python3.6/postgresql.py�
do_pg_dump0s&


zPostgreSQL.do_pg_dumpcCs |j�|jd|jd��dS)Nz	du -sh %sr)rrr)rrrr�setupRszPostgreSQL.setupN)r
)r	r)r)�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofilesZpackagesZpassword_warn_textr�str�intZoption_listrr rrrrrs&


"rcseZdZ�fdd�Z�ZS)�RedHatPostgreSQLcs�t�j�|jd�}|g}xj|D]b}xtd|�D]}|j|�q0Wxtd|�D]}|j|�qNWx dD]}|j|j|d|��qfWq WdS)Nrz*.logz*.conf�
PG_VERSION�postmaster.opts�data)r'r()�superr rr�
add_copy_specZ	path_join)rr�dirsZ_dirr�file)�	__class__rrr Ys



zRedHatPostgreSQL.setup)r!r"r#r �
__classcell__rr)r.rr&Wsr&cseZdZ�fdd�Z�ZS)�DebianPostgreSQLcs t�j�|jddddg�dS)Nz/var/log/postgresql/*.logz/etc/postgresql/*/main/*.confz%/var/lib/postgresql/*/main/PG_VERSIONz*/var/lib/postgresql/*/main/postmaster.opts)r*r r+)r)r.rrr os
zDebianPostgreSQL.setup)r!r"r#r r/rr)r.rr0msr0)rZsos.report.pluginsrrrrrZ
sos.utilitiesrrr&r0rrrr�<module>s
A

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists