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