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'
|
||||
static_configs:
|
||||
- targets:
|
||||
{% 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 %}
|
||||
metrics_path: /snmp
|
||||
params:
|
||||
|
|
Loading…
Reference in New Issue