Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3/dist-packages/sos/report/plugins/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/sos/report/plugins/__pycache__/foreman.cpython-310.pyc
o

i��d':�@s�ddlmZmZmZmZmZmZddlmZddl	m
Z
ddlmZGdd�de�Z
Gdd�de
ee�ZGd	d
�d
e
ee�ZdS)�)�Plugin�RedHatPlugin�	SCLPlugin�DebianPlugin�UbuntuPlugin�	PluginOpt)�quote)�match)�
is_executablec@sfeZdZdZdZdZdZdZedddd	�ed
ddd	�ed
ddd	�gZ	dZ
dd�Zddd�Zdd�Z
dS)�Foremanz$Foreman/Satellite systems management�foremani)�sysmgmt)r�months�z#number of months for dynflow output)�default�desc�
proxyfeaturesFz!collect features of smart proxies�puma-gczcollect Puma GC statsz/pumactl %s -S /usr/share/foreman/tmp/puma.statecCs�d}d|_d|_zAtd�����D]6}|r|ddkrq|�d�r$d}q|r2td	|�r2|��d
|_|r@td|�r@|��d
|_|�d�sGd}qWn	tyRYnw|j�d
�r_|j�	d
�sk|j�d�rs|j�	d�rs|jd
d�|_d|ji|_
|�ddddd��|�ddg�|�
d�d}|��}|�
d�d}|��}|jdd�|j�gdd�|�dddd d!d"d#d$d%d&d'd(d)d*d+�|j�d,�|j�d-�|j�d.�|j�d/�|j�d0�|j�g�|�d1d2d3d4d5d6d7d8|d8|d9g
�|jd:d;d<�|jd=d>d?�|jd@dAd<�|jdBdCd<�|jdDdE�|�dF��r#|j|jdGdHd<�|j|jdIdJd<�|�dK�|�dL�}|j|dM|j
dN�dO|�dP�}dQ}dR}dSt|�}	dTt|�}
dUt|�}dV}||dWdXdY|dZd[�}
d\|	|
|d]�}|
D]}|�|
|�}|j||d^d_|j
d`��qr|�da�}|D]$}db}|dck�r�|�r�dd}|j||d|de�}|j||d^d_|j
d`��q�|�df��r�|jdgddh�}|j
||j
di�}|djdk�r�|d��d
d�D]}|�dk�}dl|d
}|j||ddmdndo��q�|�dpdqg�dS)rNF�	localhost�z/etc/foreman/database.ymlr�#zproduction:Tz\s+host:\s+\S+rz\s+password:\s+\S+� �"�'����
PGPASSWORD�foreman_production_log�foreman_tasks_config�foreman_ssl_access_ssl_log)z!/var/log/foreman/production.log.*z/etc/sysconfig/foreman-tasks�/etc/sysconfig/dynflowdz)/var/log/httpd/foreman-ssl_access_ssl.logz/etc/foreman/*key.pemz/etc/foreman/encryption_key.rb�hostname�outputzhostname -fz/var/log/foreman/production.logz"/var/log/{}*/foreman-ssl_*_ssl.log)�	sizelimitz
/etc/foreman/z/etc/sysconfig/foremanrz/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/zforeman-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 localhostz�qpid-stat -b amqps://localhost:5671 -q                     --ssl-certificate=/etc/pki/katello/qpid_router_client.crt                     --ssl-key=/etc/pki/katello/qpid_router_client.key                     --sasl-mechanism=ANONYMOUSzqpid-stat_-q��suggest_filenamezhammer ping�hammer_ping)�tagszsystemctl list-units dynflow*�
dynflow_unitsz!"system-dynflow\x2dsidekiq.slice"�dynflow_sidekiq_statuszdynflow-sidekiq@*)�unitsrzgc-statszpumactl_gc-stats�stats�
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 DESC�foreman_db_tables_sizes)r$�envz	%s monthsrzRselect 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)�foreman_settings_table�foreman_auth_table�dynflow_schema_info�audits_table_count�logs_table_count�fact_names_prefixes�
smart_proxiesz!select * from foreman_tasks_tasks)�foreman_tasks_tasks�dynflow_execution_plans�dynflow_actions�
dynflow_stepsiX�d)r$�timeoutr"r-z
dynflow-utils�psqlr5z /usr/libexec/psql-msgpack-decode)�csv�binaryrz"select name,url from smart_proxies)r<)r-�status�,z\curl -s --key /etc/foreman/client_key.pem --cert /etc/foreman/client_cert.pem %s/v2/features�smart_proxies_features�
)r$�subdirr:�
http_proxy�https_proxy)�dbhost�dbpasswd�open�read�
splitlines�
startswithr	�split�IOError�endswithr-�
add_file_tags�add_forbidden_path�exec_cmd�strip�
add_copy_spec�format�	apachepkg�add_cmd_output�add_service_status�add_journal�
get_option�pumactl�build_query_cmdr�is_installed�add_env_var)�self�production_scope�line�	_hostname�_host_f�_cmdr�scmd�authcmd�dyncmd�
dactioncmd�	dstepscmd�factnamescmd�	foremandb�
foremancsv�table�dynutils�dynr=�proxies�proxy�rp�</usr/lib/python3/dist-packages/sos/report/plugins/foreman.py�setup%s`

���
�
���
��
��


�������
��������	�����

�
�

��
�
�z
Foreman.setupr;cCs$|rd|}d}|||jt|�fS)aI
        Builds the command needed to invoke the pgsql query as the postgres
        user.
        The query requires significant quoting work to satisfy both the
        shell and postgres parsing requirements. Note that this will generate
        a large amount of quoting in sos logs referencing the command being run
        z>COPY (%s) TO STDOUT WITH (FORMAT 'csv', DELIMITER ',', HEADER)z:%s --no-password -h %s -p 5432 -U foreman -d foreman -c %s)rEr)r]�queryr<r=�_dbcmdrprprqrZ"s�zForeman.build_query_cmdcCs4|�d|jdd�|�ddd�|�ddd�dS)	Nz(/var/log/%s*/foreman-ssl_access_ssl.log*z7(.*\?(passw|cred|token|secret|key).*=)(.*) (HTTP.*(.*))z
\1******** \4z/etc/foreman/(.*)((conf)(.*)?)z5((\:|\s*)(passw|cred|token|secret|key).*(\:\s|=))(.*)z
\1********z"/etc/foreman/(.*)((yaml|yml)(.*)?)z\1"********")�do_path_regex_subrT�r]rprprq�postproc0s���zForeman.postprocN)Fr;)�__name__�
__module__�__qualname__�
short_desc�plugin_name�plugin_timeout�profiles�packagesr�option_listrYrrrZrwrprprprqrs*����
~rcs eZdZdZ�fdd�Z�ZS)�
RedHatForeman�httpdcsR|�ddi�|j��dkrtd�rd|j|_tt|���|jdddd	�dS)
Nz"/usr/share/foreman/.ssh/ssh_config�ssh_foreman_config��sclzscl enable tfm '%s'�tfmzgem listzscl enable tfm gem listr#)	rN�policy�dist_versionr
rY�superr�rr�add_cmd_output_sclrv��	__class__rprqrrGs�
�zRedHatForeman.setup)rxryrzrTrr�
__classcell__rprpr�rqr�Csr�c@seZdZdZdS)�
DebianForeman�apache2N)rxryrzrTrprprprqr�Vsr�N)�sos.report.pluginsrrrrrr�pipesr�rer	�
sos.utilitiesr
rr�r�rprprprq�<module>s 2

Spamworldpro Mini