Backup monitoring
parent
a4e09e92f9
commit
3d834ff77a
|
@ -36,6 +36,29 @@
|
||||||
- ninjabot
|
- ninjabot
|
||||||
- grafana
|
- grafana
|
||||||
|
|
||||||
|
# Deploy backup Prometheus on backup server
|
||||||
|
- hosts: odlyd.adm.crans.org
|
||||||
|
vars:
|
||||||
|
# only critical infra
|
||||||
|
prometheus:
|
||||||
|
node_targets:
|
||||||
|
- odlyd.adm.crans.org # me, myself and I
|
||||||
|
- zamok.adm.crans.org # parce que WeeChat c'est critique
|
||||||
|
- thot.adm.crans.org # la bdd adh est critique... enfin a skip
|
||||||
|
- zbee.adm.crans.org # zbeu! la bay!
|
||||||
|
- stitch.adm.crans.org # last hope virtu
|
||||||
|
ups_snmp_targets:
|
||||||
|
- pulsar.adm.crans.org # 0B
|
||||||
|
- quasar.adm.crans.org # 4J
|
||||||
|
|
||||||
|
snmp_unifi_password: "{{ vault_snmp_unifi_password }}"
|
||||||
|
roles:
|
||||||
|
- prometheus
|
||||||
|
- prometheus-alertmanager
|
||||||
|
- prometheus-snmp-exporter
|
||||||
|
- ninjabot
|
||||||
|
|
||||||
|
|
||||||
# Monitor all hosts
|
# Monitor all hosts
|
||||||
- hosts: server,test_vm
|
- hosts: server,test_vm
|
||||||
vars:
|
vars:
|
||||||
|
|
|
@ -39,18 +39,21 @@
|
||||||
copy:
|
copy:
|
||||||
content: "{{ [{'targets': prometheus.unifi_snmp_targets}] | to_nice_json }}"
|
content: "{{ [{'targets': prometheus.unifi_snmp_targets}] | to_nice_json }}"
|
||||||
dest: /etc/prometheus/targets_unifi_snmp.json
|
dest: /etc/prometheus/targets_unifi_snmp.json
|
||||||
|
when: prometheus.unifi_snmp_targets is defined
|
||||||
|
|
||||||
# We don't need to restart Prometheus when updating nodes
|
# We don't need to restart Prometheus when updating nodes
|
||||||
- name: Configure Prometheus Apache targets
|
- name: Configure Prometheus Apache targets
|
||||||
copy:
|
copy:
|
||||||
content: "{{ [{'targets': prometheus.apache_targets}] | to_nice_json }}"
|
content: "{{ [{'targets': prometheus.apache_targets}] | to_nice_json }}"
|
||||||
dest: /etc/prometheus/targets_apache.json
|
dest: /etc/prometheus/targets_apache.json
|
||||||
|
when: prometheus.apache_targets is defined
|
||||||
|
|
||||||
# We don't need to restart Prometheus when updating nodes
|
# We don't need to restart Prometheus when updating nodes
|
||||||
- name: Configure Prometheus Blackbox targets
|
- name: Configure Prometheus Blackbox targets
|
||||||
copy:
|
copy:
|
||||||
content: "{{ [{'targets': prometheus.blackbox_targets}] | to_nice_json }}"
|
content: "{{ [{'targets': prometheus.blackbox_targets}] | to_nice_json }}"
|
||||||
dest: /etc/prometheus/targets_blackbox.json
|
dest: /etc/prometheus/targets_blackbox.json
|
||||||
|
when: prometheus.blackbox_targets is defined
|
||||||
|
|
||||||
- name: Activate prometheus service
|
- name: Activate prometheus service
|
||||||
systemd:
|
systemd:
|
||||||
|
|
|
@ -61,6 +61,7 @@ scrape_configs:
|
||||||
- target_label: __address__
|
- target_label: __address__
|
||||||
replacement: 127.0.0.1:9116
|
replacement: 127.0.0.1:9116
|
||||||
|
|
||||||
|
{% if prometheus.unifi_snmp_targets is defined %}
|
||||||
- job_name: unifi_snmp
|
- job_name: unifi_snmp
|
||||||
file_sd_configs:
|
file_sd_configs:
|
||||||
- files:
|
- files:
|
||||||
|
@ -75,7 +76,9 @@ scrape_configs:
|
||||||
target_label: instance
|
target_label: instance
|
||||||
- target_label: __address__
|
- target_label: __address__
|
||||||
replacement: 127.0.0.1:9116
|
replacement: 127.0.0.1:9116
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if prometheus.apache_targets is defined %}
|
||||||
- job_name: apache
|
- job_name: apache
|
||||||
file_sd_configs:
|
file_sd_configs:
|
||||||
- files:
|
- files:
|
||||||
|
@ -87,7 +90,9 @@ scrape_configs:
|
||||||
- source_labels: [instance]
|
- source_labels: [instance]
|
||||||
target_label: __address__
|
target_label: __address__
|
||||||
replacement: '$1:9117'
|
replacement: '$1:9117'
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if prometheus.blackbox_targets is defined %}
|
||||||
- job_name: blackbox
|
- job_name: blackbox
|
||||||
file_sd_configs:
|
file_sd_configs:
|
||||||
- files:
|
- files:
|
||||||
|
@ -102,6 +107,7 @@ scrape_configs:
|
||||||
target_label: instance
|
target_label: instance
|
||||||
- target_label: __address__
|
- target_label: __address__
|
||||||
replacement: 127.0.0.1:9115
|
replacement: 127.0.0.1:9115
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
- job_name: mtail
|
- job_name: mtail
|
||||||
static_configs:
|
static_configs:
|
||||||
|
|
Loading…
Reference in New Issue