Browse Source

Add node_exporter to the prometheus targets and fix its flags

remove-logs
Andreas Linz 3 years ago
parent
commit
64b994016c
4 changed files with 5 additions and 5 deletions
  1. +0
    -3
      roles/grafana/defaults/main.yml
  2. +3
    -0
      roles/prometheus/defaults/main.yml
  3. +1
    -1
      roles/prometheus/templates/node_exporter.service.tmpl
  4. +1
    -1
      roles/prometheus/templates/prometheus.yml.tmpl

+ 0
- 3
roles/grafana/defaults/main.yml View File

@ -6,6 +6,3 @@ grafana_db_name: grafana
grafana_db_password: ThisIsInsecure
grafana_domain: "grafana.{{ domain }}"
#grafana_password: password
node_exporter_path: /usr/bin/node_exporter
node_exporter_port: 9091
node_exporter_address: "127.0.0.1:{{ node_exporter_port }}"

+ 3
- 0
roles/prometheus/defaults/main.yml View File

@ -1,3 +1,6 @@
prometheus_path: /usr/bin/prometheus
prometheus_config_path: /etc/prometheus/config.yml
prometheus_port: 9090
node_exporter_path: /usr/bin/node_exporter
node_exporter_port: 9091
node_exporter_address: "127.0.0.1:{{ node_exporter_port }}"

+ 1
- 1
roles/prometheus/templates/node_exporter.service.tmpl View File

@ -7,7 +7,7 @@ Requires=prometheus.service
[Service]
Restart=on-abnormal
ExecStart={{ node_exporter_path }} -web.listen-address "{{ node_exporter_address }}"
ExecStart={{ node_exporter_path }} --web.listen-address "{{ node_exporter_address }}"
PrivateTmp=true
PrivateDevices=true
ProtectHome=true

+ 1
- 1
roles/prometheus/templates/prometheus.yml.tmpl View File

@ -24,4 +24,4 @@ scrape_configs:
# scheme defaults to 'http'.
static_configs:
- targets: ['localhost:9090', 'localhost:{{ caddy_prometheus_port }}']
- targets: ['localhost:9090', 'localhost:{{ caddy_prometheus_port }}', 'localhost:{{ node_exporter_port }}']

Loading…
Cancel
Save