3 ܓi@sVddlmZmZmZmZmZGdddeZGdddeeZGdddeeeZdS) )Plugin RedHatPlugin DebianPlugin UbuntuPlugin PluginOptc@s@eZdZdZdZdZdZdZdZdZ e d d d d gZ d dZ 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 webserver openshifthttpd /var/www/NlogFzgathers all apache logs)namedefaultZdescc sXjddgddjddddd d d d d ddddddg }jfdd|DdS)Nz apachectl -Sz apachectl -tT)Z cmd_as_tagz apachectl -MZhttpd_M)tagsZaodhZ ceilometerZcinderZforemanZgnocchiZhorizonZkeystoneZmanilaZnovaZoctaviaZ placementZpulpcs g|]}djd|dqS)z /var/log/z*/*) apachepkg).0sub)self/usr/lib/python3.6/apache.py @sz Apache.setup..)Zadd_cmd_outputadd_forbidden_path)rZsubdirsr)rrsetup's&z Apache.setup)rr )r )r ) __name__ __module__ __qualname____doc__Z short_descZ plugin_nameZprofilesZpackagesfilesrrZ option_listrrrrrr s rcs0eZdZdZd ZdZfddZdd ZZS) 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|jdddddtjdddg}d d |D}d d d g}dd |D}ddddg}|jdd |Dx2|D]*}x$|D]}|j|d|ddq~WqtW|jds|jdr|j|n0x.|D]&}x |D]} |j|d| qWqW|jdg|jdg|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_logZ22Z24cSsg|]}d|qS)z /etc/httpdr)rverrrrresz&RedHatApache.setup..z conf/*.confz conf.d/*.confzconf.modules.d/*.confcSsg|]}d|qS)z/var/log/httpdr)rr$rrrrnsZ access_logZ error_logZssl_access_logZ ssl_error_logcSsg|]}|dqS)z/conf/password.confr)rZetcrrrrws/Z httpd_conf)rr all_logsz/var/lib/httpd/*z/var/lib/httpd/*.pemr Zsystemctl_httpd)Z add_file_tagssuperrr add_copy_spec get_optionadd_service_status) rZversZetcdirsZconfsZlogdirsZlogsZedirZconfZldirr ) __class__rrrUs>         zRedHatApache.setupcCs |jddd|jddddS)Nz/var/lib/httpd/.*jsonz(\"e\"\s*:|\"n\"\s*:)(.*[,]$)z \1 ********,z(\"e\"\s*:|\"n\"\s*:)(.*[^,]$)z \1 ********)Zdo_path_regex_sub)rrrrpostprocszRedHatApache.postproc)r r!r") rrrrrrrr, __classcell__rr)r+rrDs  :rcs$eZdZdZdZfddZZS) DebianApache/etc/apache2/apache2.confapache2csZtj|jddg|jd|jdddddg|jd sJ|jd rV|jd gdS) Nz/etc/apache2/*z/etc/default/apache2r0z/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+rrrs  zDebianApache.setup)r/)rrrrrrr-rr)r+rr.sr.N) Zsos.report.pluginsrrrrrrrr.rrrr s7g