mirror of
https://github.com/davestephens/ansible-nas
synced 2025-01-27 10:45:14 +00:00
Add ability to scrape additional hosts with Prometheus, and scrape from HomeAssistant
This commit is contained in:
parent
2a8d86e062
commit
7d3e6825d0
2 changed files with 12 additions and 0 deletions
|
@ -36,3 +36,6 @@ stats_collection_interval: 15s
|
||||||
# uncomment to scrape more hosts
|
# uncomment to scrape more hosts
|
||||||
# stats_prometheus_additional_hosts:
|
# stats_prometheus_additional_hosts:
|
||||||
# - 192.168.1.1:9100
|
# - 192.168.1.1:9100
|
||||||
|
|
||||||
|
# uncomment to scrape metrics from HomeAssistant. You'll need to create a long lived access token.
|
||||||
|
# stats_hass_long_lived_access_token: addfasdfasdf
|
||||||
|
|
|
@ -56,3 +56,12 @@ scrape_configs:
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
- job_name: "homeassistant"
|
||||||
|
metrics_path: /api/prometheus
|
||||||
|
authorization:
|
||||||
|
credentials: "{{ stats_hass_long_lived_access_token | default("abcd") }}"
|
||||||
|
static_configs:
|
||||||
|
- targets: [
|
||||||
|
"{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:8123"
|
||||||
|
]
|
||||||
|
|
Loading…
Reference in a new issue