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

~�gu�@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.tarc	Cs�|jd�r�|jd�sdtjkr�|jd�r8|jd�tjd<|jd�rxd|jd��d|jd��d|jd	��d
|jd���}nd|jd��d
|jd���}|j||dd
d�n|jjd�|jd�dS)z- Extract PostgreSQL database into a tar file rrZ
PGPASSWORDrzpg_dump -U rz -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� /usr/lib/python3.6/postgresql.py�
do_pg_dump0s


6zPostgreSQL.do_pg_dumpcCs"|j�|jd|jd����dS)Nzdu -sh r)rrr)rrrr�setupNszPostgreSQL.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 Us



zRedHatPostgreSQL.setup)r!r"r#r �
__classcell__rr)r.rr&Ssr&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 ks
zDebianPostgreSQL.setup)r!r"r#r r/rr)r.rr0isr0)rZsos.report.pluginsrrrrrZ
sos.utilitiesrrr&r0rrrr�<module>s
=

NineSec Team - 2022