[prometheus] Monitor UPS
parent
1e922de8b0
commit
b32859ecc8
|
@ -27,7 +27,7 @@
|
||||||
job: prometheus
|
job: prometheus
|
||||||
targets:
|
targets:
|
||||||
- localhost:9090
|
- localhost:9090
|
||||||
prometheus_snmp_targets:
|
prometheus_ups_snmp_targets:
|
||||||
- targets:
|
- targets:
|
||||||
- pulsar.adm.crans.org
|
- pulsar.adm.crans.org
|
||||||
# Debian non-free mirror
|
# Debian non-free mirror
|
||||||
|
|
|
@ -23,13 +23,13 @@
|
||||||
notify: Restart Prometheus
|
notify: Restart Prometheus
|
||||||
|
|
||||||
# Doesn't work on Debian Stretch
|
# Doesn't work on Debian Stretch
|
||||||
- name: Make Prometheus snmp-exporter listen on adm only
|
- name: Make Prometheus snmp-exporter listen on localhost only
|
||||||
when:
|
when:
|
||||||
- ansible_lsb.codename == 'buster'
|
- ansible_lsb.codename == 'buster'
|
||||||
lineinfile:
|
lineinfile:
|
||||||
path: /etc/default/prometheus-snmp-exporter
|
path: /etc/default/prometheus-snmp-exporter
|
||||||
regexp: '^ARGS='
|
regexp: '^ARGS='
|
||||||
line: "ARGS=\"--web.listen-address={{ ansible_fqdn }}:9116\""
|
line: "ARGS=\"--web.listen-address=127.0.0.1:9116\""
|
||||||
notify: Restart prometheus-snmp-exporter
|
notify: Restart prometheus-snmp-exporter
|
||||||
|
|
||||||
# We don't need to restart Prometheus when updating nodes
|
# We don't need to restart Prometheus when updating nodes
|
||||||
|
@ -39,10 +39,10 @@
|
||||||
dest: /etc/prometheus/targets.json
|
dest: /etc/prometheus/targets.json
|
||||||
|
|
||||||
# We don't need to restart Prometheus when updating nodes
|
# We don't need to restart Prometheus when updating nodes
|
||||||
- name: Configure Prometheus SNMP devices
|
- name: Configure Prometheus UPS SNMP devices
|
||||||
copy:
|
copy:
|
||||||
content: "{{ prometheus_snmp_targets | to_nice_json }}"
|
content: "{{ prometheus_ups_snmp_targets | to_nice_json }}"
|
||||||
dest: /etc/prometheus/targets_snmp.json
|
dest: /etc/prometheus/targets_ups_snmp.json
|
||||||
|
|
||||||
- name: Activate prometheus service
|
- name: Activate prometheus service
|
||||||
systemd:
|
systemd:
|
||||||
|
|
|
@ -29,13 +29,13 @@ scrape_configs:
|
||||||
file_sd_configs:
|
file_sd_configs:
|
||||||
- files:
|
- files:
|
||||||
- '/etc/prometheus/targets.json'
|
- '/etc/prometheus/targets.json'
|
||||||
- job_name: snmp
|
- job_name: ups_snmp
|
||||||
file_sd_configs:
|
file_sd_configs:
|
||||||
- files:
|
- files:
|
||||||
- '/etc/prometheus/targets_snmp.json'
|
- '/etc/prometheus/targets_ups_snmp.json'
|
||||||
metrics_path: /snmp
|
metrics_path: /snmp
|
||||||
params:
|
params:
|
||||||
module: [if_mib]
|
module: [eatonups]
|
||||||
relabel_configs:
|
relabel_configs:
|
||||||
- source_labels: [__address__]
|
- source_labels: [__address__]
|
||||||
target_label: __param_target
|
target_label: __param_target
|
||||||
|
|
Loading…
Reference in New Issue