monitoring: nice labels for openwrt switches
* keep instance label * add site and location labels
This commit is contained in:
parent
8fa87485ff
commit
72df3338d3
|
@ -38,9 +38,16 @@ scrape_configs:
|
||||||
|
|
||||||
- job_name: 'snmp'
|
- job_name: 'snmp'
|
||||||
static_configs:
|
static_configs:
|
||||||
- targets:
|
|
||||||
{% for host in groups['switches_stock'] %}
|
{% for host in groups['switches_stock'] %}
|
||||||
- {{ hostvars[host]['ip'] }}
|
- targets: ["{{ hostvars[host]['ip'] }}"]
|
||||||
|
labels:
|
||||||
|
instance: "{{ host }}"
|
||||||
|
{% if hostvars[host]['site'] is defined %}
|
||||||
|
site: "{{ hostvars[host]['site'] }}"
|
||||||
|
{% endif %}
|
||||||
|
{% if hostvars[host]['location'] is defined %}
|
||||||
|
location: "{{ hostvars[host]['location'] }}"
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
metrics_path: /snmp
|
metrics_path: /snmp
|
||||||
params:
|
params:
|
||||||
|
|
Reference in New Issue