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 ] |
---|
3 ~ �g� � @ s2 d dl Z d dlmZmZmZ G dd� dee�ZdS )� N)�Plugin� PluginOpt�UbuntuPluginc @ sR e Zd ZdZdZdZdZeddedd�ed d edd�edd e dd�gZ dd� ZdS )�CharmedMySQLa_ The Charmed MySQL plugin is used to collect MySQL configuration and logs from the Charmed MySQL snap package. It also collects MySQL Router and MySQL Shell configuration and logs where available, journal logs for the snap, and snap info. If the `dumpdbs` option is set to `True`, the plugin will also try and collect the names of the databases that the user has access to. The `mysql` user is used by default, but that can be set using the `dbuser` option. When using the `dumpdbs` option, you must then provide the password for the user using the `dbpass` option. z Charmed MySQLZ charmed_mysql� charmed-mysql�dbuserZmysqlz%Username for database dump collection)�defaultZval_typeZdesc�dbpass� z%Password for database dump collection�dumpdbsFzGet name of all databasesc sd d}d}t dd� tjD ��}|r(d}d}|� d�|� d�|� d�|� d �|� d �d�}| j|d � d �|d � d�g� | j|d |d |d |d |d g� |s�| jd� | jd� | jd��r`| jd�}| jd�}dtjko�| �r| jj d� tjd }n|�s| jj d� d S d|i}d|� �}d|� d�� ddd d!d"g} | j� fd#d$�| D �|d%� d S )&Nz/var/snap/charmed-mysql/commonz/var/snap/charmed-mysql/currentc s s | ]}d |kV qdS )Z KUBERNETESN� )�.0�keyr r �#/usr/lib/python3.6/charmed_mysql.py� <genexpr>5 s z%CharmedMySQL.setup.<locals>.<genexpr>r z /etc/mysqlz/var/log/mysqlz/etc/mysqlrouterz/var/log/mysqlrouterz/var/log/mysqlsh)� MYSQL_CONF� MYSQL_LOGS�MYSQL_ROUTER_CONF�MYSQL_ROUTER_LOGS�MYSQL_SHELL_LOGSr z/*.pemz/*.keyr r r r zsnap.charmed-mysql.*zsnap info charmed-mysqlr r r Z MYSQL_PWDzWMYSQL_PWD present: Using MYSQL_PWD environment variable, user did not provide password.zHdumpdbs_error: option is set, but username and password are not providedz-h 127.0.0.1 -uzmysql z -ez'show databases;'z,'select * from mysql.juju_units_operations;'zR'select * from performance_schema.replication_group_members order by MEMBER_HOST;'z$'show global status like "%conne%";'z.'select * from performance_schema.host_cache;'c s g | ]}� � d |� ��qS )� r )r Zquery)�sql_cmdr r � <listcomp>� s z&CharmedMySQL.setup.<locals>.<listcomp>)�env)�any�os�environZadd_forbidden_pathZ add_copy_specZadd_journalZadd_cmd_outputZ get_optionZsoslog�infoZwarning) �selfZsnap_path_commonZsnap_path_currentZ k8s_deployZ conf_pathsZdb_userZdb_passZ mysql_envZoptsZqueriesr )r r �setup/ sZ zCharmedMySQL.setupN)r )�__name__� __module__�__qualname__�__doc__Z short_descZplugin_nameZpackagesr �str�boolZoption_listr r r r r r s r )r Zsos.report.pluginsr r r r r r r r �<module> s