Sindbad~EG File Manager

Current Path : /lib/python3.6/site-packages/sos/report/plugins/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/sos/report/plugins/__pycache__/apache.cpython-36.pyc

3

�f��@sVddlmZmZmZmZmZGdd�de�ZGdd�dee�ZGdd�deee�ZdS)	�)�Plugin�RedHatPlugin�DebianPlugin�UbuntuPlugin�	PluginOptc@s@eZdZdZdZdZdZdZdZdZ	e
d	d
dd�gZd
d�ZdS)�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 daemonZapache�	webserver�	openshift�httpd�	/var/www/N�logFzgathers all apache logs)�name�defaultZdesccsX�jddgdd��jddd�dd	d
ddd
ddddddg}�j�fdd�|D��dS)Nzapachectl -Szapachectl -tT)Z
cmd_as_tagzapachectl -MZhttpd_M)�tagsZaodhZ
ceilometerZcinderZforemanZgnocchiZhorizonZkeystoneZmanilaZnovaZoctaviaZ	placementZpulpcsg|]}d�j|f�qS)z/var/log/%s*/%s*)�	apachepkg)�.0�sub)�self��/usr/lib/python3.6/apache.py�
<listcomp>@sz Apache.setup.<locals>.<listcomp>)Zadd_cmd_output�add_forbidden_path)rZsubdirsr)rr�setup's&zApache.setup)rr	)r
)r)
�__name__�
__module__�__qualname__�__doc__Z
short_descZplugin_nameZprofilesZpackages�filesrrZoption_listrrrrrr
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.
    �/etc/httpd/conf/httpd.conf�/etc/httpd22/conf/httpd.conf�/etc/httpd24/conf/httpd.confr
c
s|jddddd��t�j�dddg}d	d
�|D�}ddd
g}dd
�|D�}ddddg}|jdd
�|D��x0|D](}x"|D]}|jd||fdd�q~WqtW|jd�s�|jd�r�|j|�n.x,|D]$}x|D]}	|jd||	f�q�Wq�W|jddd�dS)NZhttpd_access_logZhttpd_error_logZhttpd_ssl_access_logZhttpd_ssl_error_log)z/var/log/httpd/access_logz/var/log/httpd/error_logz/var/log/httpd/ssl_access_logz/var/log/httpd/ssl_error_log�Z22Z24cSsg|]}d|�qS)z/etc/httpd%sr)r�verrrrresz&RedHatApache.setup.<locals>.<listcomp>zconf/*.confz
conf.d/*.confzconf.modules.d/*.confcSsg|]}d|�qS)z/var/log/httpd%sr)rr#rrrrnsZ
access_logZ	error_logZssl_access_logZ
ssl_error_logcSsg|]}d|�qS)z%s/conf/password.confr)rZetcrrrrwsz%s/%sZ
httpd_conf)rr�all_logsr
Zsystemctl_httpd)Z
add_file_tags�superrr�
add_copy_spec�
get_option�add_service_status)
rZversZetcdirsZconfsZlogdirsZlogsZedirZconfZldirr)�	__class__rrrUs6






zRedHatApache.setup)rr r!)rrrrrrr�
__classcell__rr)r)rrDs	rcs$eZdZdZdZ�fdd�Z�ZS)�DebianApache�/etc/apache2/apache2.conf�apache2csZt�j�|jddg�|jd�|jdddddg�|jd	�sJ|jd
�rV|jdg�dS)Nz/etc/apache2/*z/etc/default/apache2r-z/var/log/apache2/access.logz/var/log/apache2/error.logz/var/log/apache2/ssl_access.logz/var/log/apache2/ssl_error.logz(/var/log/apache2/other_vhosts_access.logrr$z/var/log/apache2)r%rr&r(r')r)r)rrr�s

zDebianApache.setup)r,)rrrrrrr*rr)r)rr+�sr+N)	Zsos.report.pluginsrrrrrrrr+rrrr�<module>	s7D

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists