diff --git a/tasks/apache.yml b/tasks/apache.yml index df0e606acfbba1386a80c2976dc414e2bf32f662..6e20d004ea6af29b8b9f637cd4a7126ca1c00383 100644 --- a/tasks/apache.yml +++ b/tasks/apache.yml @@ -19,3 +19,11 @@ - name: "Enable Apache Status Site" command: a2ensite status creates=/etc/apache2/sites-enabled/status{{ apache_conf_ext|default('.conf') }} notify: "Restart Apache" + +- name: "Weblog Module Configuration" + template: + src: 'web_log.conf' + dest: '/etc/netdata/python.d/web_log.conf' + owner: 'netdata' + group: 'netdata' + mode: '660' diff --git a/tasks/configure.yml b/tasks/configure.yml index a482faf0eecd610369b60906768972a4d2d32d83..6e925755b24d4c7fcc928ddb943997156e997b5d 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -32,6 +32,7 @@ backup: yes with_items: - 'health_alarm_notify.conf' + - 'python.d.conf' notify: - "Restart NetData" diff --git a/templates/python.d.conf b/templates/python.d.conf index b6520e6ae02ad5e8d4a07820965b6784cb1490d0..03ee69c9d88633df56a765fb2dfb63bffbd3a3aa 100644 --- a/templates/python.d.conf +++ b/templates/python.d.conf @@ -23,20 +23,36 @@ log_interval: 3600 # Setting any of these to no will disable it. apache: {{ (groups['webserver'] is defined and inventory_hostname in groups['webserver'])|ternary("yes", "no") }} -apache_cache: {{ (groups['webserver'] is defined and inventory_hostname in groups['webserver'])|ternary("yes", "no") }} +apache_cache: no +bind_rndc: yes cpufreq: yes +cpuidle: yes dovecot: no +elasticsearch: {{ (groups['logserver'] is defined and inventory_hostname in groups['logserver'])|ternary("yes", "no") }} example: no exim: no +fail2ban: yes +freeradius: yes +gunicorn_log: no +haproxy: {{ (groups['proxyserver'] is defined and inventory_hostname in groups['proxyserver'])|ternary("yes", "no") }} hddtemp: yes ipfs: no +isc_dhcpd: yes +mdstat: yes memcached: {{ (groups['webserver'] is defined and inventory_hostname in groups['webserver'])|ternary("yes", "no") }} mysql: {{ (groups['dbserver-mysql'] is defined and inventory_hostname in groups['dbserver-mysql'])|ternary("yes", "no") }} nginx: no nginx_log: no +nginx_log: no +ovpn_status_log: yes phpfpm: {{ (groups['webserver'] is defined and inventory_hostname in groups['webserver'])|ternary("yes", "no") }} postfix: yes +postgres: yes redis: {{ (groups['webserver'] is defined and inventory_hostname in groups['webserver'])|ternary("yes", "no") }} +retroshare: yes sensors: yes +smartd_log: yes squid: no tomcat: no +varnish: {{ (groups['varnishserver'] is defined and inventory_hostname in groups['varnishserver'])|ternary("yes", "no") }} +web_log: {{ (groups['webserver'] is defined and inventory_hostname in groups['webserver'])|ternary("yes", "no") }} diff --git a/templates/web_log.conf b/templates/web_log.conf new file mode 100644 index 0000000000000000000000000000000000000000..b73c2d591b6da03dfa30ec041dfd474020a6d268 --- /dev/null +++ b/templates/web_log.conf @@ -0,0 +1,43 @@ +apache_log: + name: 'apache' + path: '/var/log/apache2/access.log' + +apache_ssl_log: + name: 'apache_ssl' + path: '/var/log/apache2/ssl_access.log' + +apache_vhosts_log: + name: 'apache_vhosts' + path: '/var/log/apache2/other_vhosts_access.log' +{% for drupal in drupal_settings|default([]) %} +{% for drupal_domain in drupal.domains|default([]) %} + +apache_log_{{ drupal_domain.domain|regex_replace('[\.\-]', '_') }}: + name: 'apache_{{ drupal_domain.domain|regex_replace('[\.\-]', '_') }}' + path: '{% if drupal.jail is defined %}{{ jailroot|default('/jails') }}/{{ drupal.jail.name }}{% endif %}/var/log/apache2/{{ drupal_domain.domain }}-access.log' +{% endfor %} +{% endfor %} +{% for nextcloud in nextcloud_settings|default([]) %} + +apache_log_{{ nextcloud.domain|regex_replace('[\.\-]', '_') }}: + name: 'apache_{{ nextcloud.domain|regex_replace('[\.\-]', '_') }}' + path: '{% if nextcloud.jail is defined %}{{ jailroot|default('/jails') }}/{{ nextcloud.jail.name }}{% endif %}/var/log/apache2/{{ nextcloud.domain }}-access.log' +{% endfor %} +{% for piwik in piwik_settings|default([]) %} + +apache_log_{{ piwik.domain|regex_replace('[\.\-]', '_') }}: + name: 'apache_{{ piwik.domain|regex_replace('[\.\-]', '_') }}' + path: '{% if piwik.jail is defined %}{{ jailroot|default('/jails') }}/{{ piwik.jail.name }}{% endif %}/var/log/apache2/{{ piwik.domain }}-access.log' +{% endfor %} +{% for youtrack in youtrack_settings|default([]) %} + +apache_log_{{ youtrack.domain|regex_replace('[\.\-]', '_') }}: + name: 'apache_{{ youtrack.domain|regex_replace('[\.\-]', '_') }}' + path: '{% if youtrack.jail is defined %}{{ jailroot|default('/jails') }}/{{ youtrack.jail.name }}{% endif %}/var/log/apache2/{{ youtrack.domain }}-access.log' +{% endfor %} +{% for log in apache_logs|default([]) %} + +apache_log_{{ log.name }}: + name: 'apache_{{ log.name }}' + path: '{{ log.file }}' +{% endfor %}