o id@sVddlmZmZmZmZmZGdddeZGdddeeZGdddeeeZdS) )Plugin RedHatPlugin DebianPlugin UbuntuPlugin PluginOptc@s<eZdZdZdZdZdZdZdZe ddd d gZ d d Z d S)ApacheaThe 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 daemonapache) webserver openshift)httpd)z /var/www/logFzgathers all apache logs)namedefaultdesccsDjddgddjdddgd}fd d |DdS) Nz apachectl -Sz apachectl -tT) cmd_as_tagz apachectl -Mhttpd_Mtags) aodh ceilometercinderforemangnocchihorizonkeystonemanilanovaoctavia placementpulpcsg|] }dj|fqS)z/var/log/%s*/%s*) apachepkg).0subself;/usr/lib/python3/dist-packages/sos/report/plugins/apache.py >sz Apache.setup..)add_cmd_outputadd_forbidden_path)r$subdirsr%r#r&setup&s z Apache.setupN) __name__ __module__ __qualname____doc__ short_desc plugin_nameprofilespackagesfilesr option_listr+r%r%r%r&r s  rcs(eZdZdZdZdZfddZZS) 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.confr c s|dddddtt|gd}dd|D}gd }d d|D}gd }|d d|D|D]}|D] }|jd ||fddq;q7|dsT|drZ||n|D]}|D] } |d || fq`q\|jddddS)Nhttpd_access_loghttpd_error_loghttpd_ssl_access_loghttpd_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)2224cSg|]}d|qS)z /etc/httpd%sr%r!verr%r%r&r'dz&RedHatApache.setup..)z conf/*.confz conf.d/*.confzconf.modules.d/*.confcSr>)z/var/log/httpd%sr%r?r%r%r&r'mrA) access_log error_logssl_access_log ssl_error_logcSr>)z%s/conf/password.confr%)r!etcr%r%r&r'usz%s/%s httpd_confrr all_logsr systemctl_httpd) add_file_tagssuperr6r+r) add_copy_spec get_optionadd_service_status) r$versetcdirsconfslogdirslogsedirconfldirr  __class__r%r&r+Ts4  zRedHatApache.setup)r,r-r.r/r4r r+ __classcell__r%r%rWr&r6Cs  r6cs$eZdZdZdZfddZZS) DebianApache)z/etc/apache2/apache2.confapache2cs\tt||ddg|d|gd|ds$|dr,|dgdSdS)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 rHz/var/log/apache2)rKrZr+rLrNrMr#rWr%r&r+s  zDebianApache.setup)r,r-r.r4r r+rYr%r%rWr&rZsrZN) sos.report.pluginsrrrrrrr6rZr%r%r%r&s6D