[monitoring] Use ip filter for adm
parent
43d66a3257
commit
0d36ac644c
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
# Custom header
|
||||
dirty: "{{lookup('pipe', 'git diff --quiet || echo dirty')}}"
|
||||
ansible_header: |
|
||||
+++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
@ -11,3 +12,6 @@ ansible_header: |
|
|||
{% endif %}
|
||||
|
||||
+++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
# Crans subnets
|
||||
adm_subnet: 10.231.136.0/24
|
||||
|
|
|
@ -38,10 +38,14 @@
|
|||
|
||||
# Monitor all hosts
|
||||
- hosts: server,test_vm
|
||||
vars:
|
||||
adm_ipv4: "{{ ansible_all_ipv4_addresses | ipaddr(adm_subnet) | first }}"
|
||||
roles: ["prometheus-node-exporter"]
|
||||
|
||||
# Export apache metrics
|
||||
- hosts: zamok.adm.crans.org
|
||||
vars:
|
||||
adm_ipv4: "{{ ansible_all_ipv4_addresses | ipaddr(adm_subnet) | first }}"
|
||||
roles: ["prometheus-apache-exporter"]
|
||||
|
||||
# Configure HP RAID monitoring
|
||||
|
|
|
@ -12,5 +12,5 @@
|
|||
path: /etc/default/prometheus-apache-exporter
|
||||
regexp: '^ARGS='
|
||||
line: |
|
||||
ARGS="-telemetry.address={{ ansible_hostname }}.adm.crans.org:9117"
|
||||
ARGS="-telemetry.address={{ adm_ipv4 }}:9117"
|
||||
notify: Restart prometheus-apache-exporter
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
# Due to shell scaping, to pass backslashes for regexes, you need to double
|
||||
# them (\\d for \d). If running under systemd, you need to double them again
|
||||
# (\\\\d to mean \d), and escape newlines too.
|
||||
ARGS="--web.listen-address={{ lookup('dig', ansible_host) }}:9100"
|
||||
ARGS="--web.listen-address={{ adm_ipv4 }}:9100"
|
||||
|
||||
# Prometheus-node-exporter supports the following options:
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue