diff --git a/hosts.yml b/hosts.yml index 41bcf57..f211541 100644 --- a/hosts.yml +++ b/hosts.yml @@ -99,6 +99,7 @@ prometheus: prometheus02.home.foo.sh: vars: mysqld_exporter_version: "0.15.1" + nginx_exporter_version: "1.1.0" proxy: hosts: proxy01.home.foo.sh: diff --git a/playbooks/prometheus.yml b/playbooks/prometheus.yml index 856b0a3..cef9acf 100644 --- a/playbooks/prometheus.yml +++ b/playbooks/prometheus.yml @@ -27,3 +27,4 @@ - base - prometheus - mysqld_exporter + - nginx_exporter diff --git a/roles/prometheus/templates/prometheus.yml.j2 b/roles/prometheus/templates/prometheus.yml.j2 index 49520f9..ee9c9cb 100644 --- a/roles/prometheus/templates/prometheus.yml.j2 +++ b/roles/prometheus/templates/prometheus.yml.j2 @@ -29,6 +29,16 @@ scrape_configs: - target_label: __address__ replacement: {{ inventory_hostname }}:9104 + - job_name: nginx + scheme: https + tls_config: + ca_file: "{{ tls_certs }}/ca.crt" + key_file: "{{ tls_private }}/{{ inventory_hostname }}.key" + cert_file: "{{ tls_certs }}/{{ inventory_hostname }}.crt" + static_configs: + - targets: + - {{ inventory_hostname }}:9113 + - job_name: snmp scheme: https tls_config: