a >h@sVddlmZmZmZmZmZGdddeZGdddeeZGdddeeeZdS) )Plugin RedHatPlugin DebianPlugin UbuntuPlugin PluginOptc@s@eZdZdZdZdZdZdZdZdZ e dd d d gZ d d Z dS)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 daemonZapache)Z webserverZ openshift)httpd)z /var/www/NlogFzgathers all apache logs)namedefaultZdesccsDjddgddjdddgd}fd d |DdS) Nz apachectl -Sz apachectl -tT)Z cmd_as_tagz apachectl -MZhttpd_Mtags) ZaodhZ ceilometerZcinderZforemanZgnocchiZhorizonZkeystoneZmanilaZnovaZoctaviaZ placementZpulpcs g|]}djd|dqS)z /var/log/z*/*) apachepkg).0subself=/usr/lib/python3.9/site-packages/sos/report/plugins/apache.py ?sz Apache.setup..)Zadd_cmd_outputadd_forbidden_path)rsubdirsrrrsetup'sz Apache.setup) __name__ __module__ __qualname____doc__Z short_descZ plugin_nameZprofilesZpackagesfilesrrZ option_listrrrrrr s rcs0eZdZdZdZdZfddZddZZS) 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|dddddtgd}dd|D}gd }d d|D}gd }|d d|D|D]&}|D]}|j|d |ddqrqj|ds|dr||n(|D]"}|D]} ||d | qq|dg|dg|jddddS)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/httpdrrZverrrrrez&RedHatApache.setup..)z conf/*.confz conf.d/*.confzconf.modules.d/*.confcSsg|]}d|qS)z/var/log/httpdrr!rrrrnr")Z access_logZ error_logZssl_access_logZ ssl_error_logcSsg|]}|dqS)z/conf/password.confr)retcrrrrvs/Z httpd_confr r all_logsz/var/lib/httpd/*z/var/lib/httpd/*.pemrZsystemctl_httpd)Z add_file_tagssuperrr add_copy_spec get_optionadd_service_status) rZversZetcdirsZconfsZlogdirsZlogsZedirZconfZldirr  __class__rrrUs<   zRedHatApache.setupcCs |ddd|ddddS)Nz/var/lib/httpd/.*jsonz(\"e\"\s*:|\"n\"\s*:)(.*[,]$)z \1 ********,z(\"e\"\s*:|\"n\"\s*:)(.*[^,]$)z \1 ********)Zdo_path_regex_subrrrrpostprocszRedHatApache.postproc) rrrrrrrr, __classcell__rrr*rrDs   :rcs$eZdZdZdZfddZZS) DebianApache)z/etc/apache2/apache2.confapache2csTt|ddg|d|gd|dsD|drP|dgdS)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(rr*rrrs  zDebianApache.setup)rrrrrrr-rrr*rr.sr.N) Zsos.report.pluginsrrrrrrrr.rrrr s7g