| Current Path : /lib/python3/dist-packages/sos/report/plugins/__pycache__/ |
| Current File : //lib/python3/dist-packages/sos/report/plugins/__pycache__/foreman.cpython-38.pyc |
U
���bJ8 � @ s� d dl mZmZmZmZmZmZ d dlmZ d dl m
Z
d dlmZ G dd� de�Z
G dd� de
ee�ZG d d
� d
e
ee�ZdS )� )�Plugin�RedHatPlugin� SCLPlugin�DebianPlugin�UbuntuPlugin� PluginOpt)�quote)�match)�
is_executablec @ sf e Zd ZdZdZdZdZdZedddd �ed
ddd �ed
ddd �gZ dZ
dd� Zddd�Zdd� Z
dS )�Foremanz$Foreman/Satellite systems management�foremani )Zsysmgmt)r �months� z#number of months for dynflow output)�defaultZdesc�
proxyfeaturesFz!collect features of smart proxies�puma-gczcollect Puma GC statsz/pumactl %s -S /usr/share/foreman/tmp/puma.statec C s� d}d| _ d| _z�td��� �� D ]l}|r"|d dkr8q"|�d�rHd}q"|rdtd |�rd|�� d
| _ |r�td|�r�|�� d
| _|�d�s"d}q"W n tk
r� Y nX | j�d
�r�| j� d
�s�| j�d�r�| j� d�r�| jd
d� | _d| ji| _
| �dddd�� | �ddg� | �
d�d }|�� }| �
d�d }|�� }| jdd�| j�gdd� | �ddddd d!d"d#d$d%d&d'd(d)d*�| j�d+�| j�d,�| j�d-�| j�d.�| j�d/�| j�g� | �d0d1d2d3d4d5d6d7d8| d8| d9g� | jd:d;d<� | jd=d>d<� | jd?d@� | �dA��r,| j| jdB dCd<� | j| jdD dEd<� | �dF� | �dG�}| j|dH| j
dI� dJ| �dK� }dL}dM}dNt|� } dOt|� }
dPt|� }dQ}||dRdSdT|dUdV�}
dW| |
|dX�}|
D ]*}| �|
| �}| j||dYdZ| j
d[� �q�| �d\�}|D ]H}d]}|d^k�r |�r d_}| j|| d|d`�}| j||dYdZ| j
d[� �q| �da��r�| jdbddc�}| j
|| j
dd�}|de dk�r�|d �� d
d � D ]2}|�df�}dg|d
}| j||d dhdidj� �q�| �dkdlg� d S )mNFZ localhost� z/etc/foreman/database.ymlr �#zproduction:Tz\s+host:\s+\S+r z\s+password:\s+\S+� �"�'���Z
PGPASSWORDZforeman_production_logZforeman_tasks_config)z!/var/log/foreman/production.log.*z/etc/sysconfig/foreman-tasks�/etc/sysconfig/dynflowdz/etc/foreman/*key.pemz/etc/foreman/encryption_key.rbZhostname�outputzhostname -fz/var/log/foreman/production.logz"/var/log/{}*/foreman-ssl_*_ssl.log)� sizelimitz
/etc/foreman/z/etc/sysconfig/foremanr z/etc/default/foremanz&/var/log/foreman/dynflow_executor*log*z*/var/log/foreman/dynflow_executor*.output*z#/var/log/foreman/apipie_cache*.log*z/var/log/foreman/cron*.log*z /var/log/foreman/db_migrate*log*z/var/log/foreman/db_seed*log*z$/var/log/foreman/production.log[.-]*z$/var/log/foreman-selinux-install.logz&/var/log/foreman-proxy-certs-generate*z/usr/share/foreman/Gemfile*z/var/log/{}*/foreman*z2/var/log/{}*/katello-reverse-proxy_access_ssl.log*z1/var/log/{}*/katello-reverse-proxy_error_ssl.log*z/var/log/{}*/error_log*z/etc/{}*/conf/z/etc/{}*/conf.d/zhammer pingzforeman-selinux-relabel -nvzpassenger-status --show poolz passenger-status --show requestsz"passenger-status --show backtraceszpassenger-memory-statszls -lanR /root/ssl-buildz(ls -lanR /usr/share/foreman/config/hookszping -c1 -W1 %szping -c1 -W1 localhostzsystemctl list-units dynflow*Z
dynflow_units��suggest_filenamez!"system-dynflow\x2dsidekiq.slice"Zdynflow_sidekiq_statuszdynflow-sidekiq@*)Zunitsr zgc-statszpumactl_gc-statsZstatsZ
pumactl_statsz/usr/sbin/foreman-puma-statusa[ SELECT table_name, pg_size_pretty(total_bytes) AS total, pg_size_pretty(index_bytes) AS INDEX , pg_size_pretty(toast_bytes) AS toast, pg_size_pretty(table_bytes) AS TABLE FROM ( SELECT *, total_bytes-index_bytes-COALESCE(toast_bytes,0) AS table_bytes FROM (SELECT c.oid,nspname AS table_schema, relname AS TABLE_NAME, c.reltuples AS row_estimate, pg_total_relation_size(c.oid) AS total_bytes, pg_indexes_size(c.oid) AS index_bytes, pg_total_relation_size(reltoastrelid) AS toast_bytes FROM pg_class c LEFT JOIN pg_namespace n ON n.oid = c.relnamespace WHERE relkind = 'r') a) a order by total_bytes DESCZforeman_db_tables_sizes)r �envz %s monthsr
zRselect id,name,value from settings where name not similar to '%(pass|key|secret)%'z]select type,name,host,port,account,base_dn,attr_login,onthefly_register,tls from auth_sourcesz�select dynflow_execution_plans.* from foreman_tasks_tasks join dynflow_execution_plans on (foreman_tasks_tasks.external_id = dynflow_execution_plans.uuid::varchar) where foreman_tasks_tasks.started_at > NOW() - interval %sz�select dynflow_actions.* from foreman_tasks_tasks join dynflow_actions on (foreman_tasks_tasks.external_id = dynflow_actions.execution_plan_uuid::varchar) where foreman_tasks_tasks.started_at > NOW() - interval %sz�select dynflow_steps.* from foreman_tasks_tasks join dynflow_steps on (foreman_tasks_tasks.external_id = dynflow_steps.execution_plan_uuid::varchar) where foreman_tasks_tasks.started_at > NOW() - interval %sz�WITH prefix_counts AS (SELECT split_part(name,'::',1) FROM fact_names) SELECT COUNT(*), split_part AS "fact_name_prefix" FROM prefix_counts GROUP BY split_part ORDER BY count DESC LIMIT 100z!select * from dynflow_schema_infozselect count(*) from auditszselect count(*) from logsz2select name,url,download_policy from smart_proxies)Zforeman_settings_tableZforeman_auth_tableZdynflow_schema_infoZaudits_table_countZlogs_table_countZfact_names_prefixesZ
smart_proxiesz!select * from foreman_tasks_tasks)�foreman_tasks_tasksZdynflow_execution_plansZdynflow_actionsZ
dynflow_stepsiX �d )r �timeoutr r z
dynflow-utils�psqlr z /usr/libexec/psql-msgpack-decode)�csv�binaryr z"select name,url from smart_proxies)r"