mirror of
https://codeberg.org/icewind/prometheus-edge-trigger.git
synced 2026-06-03 18:24:10 +02:00
more readme
This commit is contained in:
parent
06cd2a4106
commit
5d57704fa7
1 changed files with 24 additions and 1 deletions
23
README.md
23
README.md
|
|
@ -26,3 +26,26 @@ params.host = { type = "mdns", service = "_switch-http._tcp.local", host = "swit
|
||||||
url = "http://$host/off"
|
url = "http://$host/off"
|
||||||
delay = 300
|
delay = 300
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
To remove the need to hard code ip addresses or host names, you can configure parameters to query for an ip address and
|
||||||
|
use it in a query or url.
|
||||||
|
|
||||||
|
### MDNS
|
||||||
|
|
||||||
|
```toml
|
||||||
|
params.host = { type = "mdns", service = "_switch-http._tcp.local", host = "switch2" }
|
||||||
|
```
|
||||||
|
|
||||||
|
Will attempt to lookup a host advertising itself under the `_switch-http._tcp.local` service with host name `switch2`
|
||||||
|
and return the ip address and port of the host.
|
||||||
|
|
||||||
|
### Service
|
||||||
|
|
||||||
|
```toml
|
||||||
|
params.host = { type = "service", file = "services.json", key = "hostname", value = "switch2" }
|
||||||
|
```
|
||||||
|
|
||||||
|
Will look for a host in a json file in [prometheus' file based service discovery format](https://prometheus.io/docs/guides/file-sd/)
|
||||||
|
for an entry containing the label `hostname` with value `switch2` and return the first target.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue