HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux ip-10-0-8-47 6.8.0-1021-aws #23~22.04.1-Ubuntu SMP Tue Dec 10 16:31:58 UTC 2024 aarch64
User: ubuntu (1000)
PHP: 8.1.2-1ubuntu2.22
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/sos/report/plugins/__pycache__/apache.cpython-310.pyc
o

���b��@sVddlmZmZmZmZmZGdd�de�ZGdd�dee�ZGdd�deee�ZdS)	�)�Plugin�RedHatPlugin�DebianPlugin�UbuntuPlugin�	PluginOptc@s<eZdZdZdZdZdZdZdZe	ddd	d
�gZ
dd�Zd
S)�Apachea�The Apache plugin covers the upstream Apache webserver project,
    regardless of the packaged name; apache2 for Debian and Ubuntu, or httpd
    for Red Hat family distributions.

    The aim of this plugin is for Apache-specific information, not necessarily
    other projects that happen to place logs or similar files within the
    standardized apache directories. For example, OpenStack components that log
    to apache logging directories are excluded from this plugin and collected
    via their respective OpenStack plugins.

    Users can expect the collection of apachectl command output, apache server
    logs, and apache configuration files from this plugin.
    zApache http daemon�apache)�	webserver�	openshift)�httpd)z	/var/www/�logFzgathers all apache logs)�name�default�desccs6�jgd�dd�gd�}���fdd�|D��dS)N)zapachectl -Mzapachectl -Szapachectl -tT)�
cmd_as_tag)	�aodh�
ceilometer�cinder�foreman�horizon�keystone�nova�	placement�pulpcsg|]	}d�j|f�qS)z/var/log/%s*/%s*)�	apachepkg)�.0�sub��self��;/usr/lib/python3/dist-packages/sos/report/plugins/apache.py�
<listcomp>;s�z Apache.setup.<locals>.<listcomp>)�add_cmd_output�add_forbidden_path)r�subdirsrrr �setup&s
��zApache.setupN)�__name__�
__module__�__qualname__�__doc__�
short_desc�plugin_name�profiles�packages�filesr�option_listr%rrrr r
s�rcs(eZdZdZdZdZ�fdd�Z�ZS)�RedHatApachea~
    On Red Hat distributions, the Apache plugin will also attempt to collect
    JBoss Web Server logs and configuration files.

    Note that for Red Hat distributions, this plugin explicitly collects for
    'httpd' installations. If you have installed apache from source or via any
    method that uses the name 'apache' instead of 'httpd', these collections
    will fail.
    )z/etc/httpd/conf/httpd.confz/etc/httpd22/conf/httpd.confz/etc/httpd24/conf/httpd.confrc
s�|�ddddd��tt|���gd�}dd�|D�}gd	�}d
d�|D�}gd�}|�dd�|D��|D]}|D]
}|jd
||fdd�q;q7|�d�sT|�d�rZ|�|�n|D]}|D]}	|�d
||	f�q`q\|jddd�dS)N�httpd_access_log�httpd_error_log�httpd_ssl_access_log�httpd_ssl_error_log)z
.*/access_logz.*/error_logz.*/ssl_access_logz.*/ssl_error_log)��22�24cS�g|]}d|�qS)z/etc/httpd%sr�r�verrrr r!a�z&RedHatApache.setup.<locals>.<listcomp>)zconf/httpd.confz
conf.d/*.confzconf.modules.d/*.confcSr8)z/var/log/httpd%srr9rrr r!jr;)�
access_log�	error_log�ssl_access_log�
ssl_error_logcSr8)z%s/conf/password.confr)r�etcrrr r!rs�z%s/%s�
httpd_conf)�tagsr�all_logsr�systemctl_httpd)�
add_file_tags�superr0r%r#�
add_copy_spec�
get_option�add_service_status)
r�vers�etcdirs�confs�logdirs�logs�edir�conf�ldirr��	__class__rr r%Qs4�
���zRedHatApache.setup)r&r'r(r)r.rr%�
__classcell__rrrRr r0@s
	r0cs$eZdZdZdZ�fdd�Z�ZS)�DebianApache)z/etc/apache2/apache2.confrcsZtt|���|�ddg�|�d�|�ddg�|�d�s$|�d�r+|�d�dSdS)	Nz/etc/apache2/*z/etc/default/apache2�apache2z/var/log/apache2/access_logz/var/log/apache2/error_logrrCz/var/log/apache2/*)rFrUr%rGrIrHrrRrr r%�s�
��zDebianApache.setup)r&r'r(r.rr%rTrrrRr rU�srUN)	�sos.report.pluginsrrrrrrr0rUrrrr �<module>s3D