This commit is contained in:
aexel90 2020-12-29 15:14:36 +01:00
parent ea963647bc
commit 19295e8ffc
3 changed files with 23 additions and 10 deletions

View file

@ -19,20 +19,26 @@ Usage:
$GOPATH/bin/hue_exporter -h $GOPATH/bin/hue_exporter -h
Usage of ./hue_exporter: Usage of ./hue_exporter:
-collect
Collect all available metrics
-collect-file string
The JSON file where to store collect results
-hue-url string -hue-url string
The URL of the bridge The URL of the bridge
-listen-address string -listen-address string
The address to listen on for HTTP requests. (default "127.0.0.1:9773") The address to listen on for HTTP requests. (default "127.0.0.1:9773")
-metrics-file string
The JSON file with the metric definitions. (default "hue_metrics.json")
-test -test
test configured metrics Test configured metrics
-username string -username string
The username token having bridge access The username token having bridge access
## Example execution ## Example execution
### Running within prometheus: ### Running within prometheus:
$GOPATH/bin/hue_exporter -hue_url 192.168.xxx.xxx -username ZlEH24zabK2jTpJ... $GOPATH/bin/hue_exporter -hue_url 192.168.xxx.xxx -username ZlEH24zabK2jTpJ... -metrics-file hue_metrics.json
# HELP hue_light_status status of lights registered at hue bridge # HELP hue_light_status status of lights registered at hue bridge
# TYPE hue_light_status gauge # TYPE hue_light_status gauge
@ -47,7 +53,14 @@ Usage:
### Test exporter: ### Test exporter:
$GOPATH/bin/hue_exporter -hue_url 192.168.xxx.xxx -username ZlEH24zabK2jTpJ... -test $GOPATH/bin/hue_exporter -hue_url 192.168.xxx.xxx -username ZlEH24zabK2jTpJ... -test -metrics-file hue_metrics.json
### Collect:
$GOPATH/bin/hue_exporter -hue_url 192.168.xxx.xxx -username ZlEH24zabK2jTpJ... -collect -metrics-file hue_metrics.json -collect-file result.json
## Grafana Dashboard ## Grafana Dashboard
Dashboard ID is 13645.
![Grafana](https://raw.githubusercontent.com/aexel90/hue_exporter/main/grafana/screenshot.jpg)

View file

@ -73,7 +73,7 @@
}, },
{ {
"type": "bridge", "type": "bridge",
"fqname": "hue_brdige_info", "fqname": "hue_bridge_info",
"help": "Non-numeric data, value is always 1", "help": "Non-numeric data, value is always 1",
"labels": [ "labels": [
"api_version", "api_version",

View file

@ -22,8 +22,8 @@ var (
flagAddress = flag.String("listen-address", "127.0.0.1:9773", "The address to listen on for HTTP requests.") flagAddress = flag.String("listen-address", "127.0.0.1:9773", "The address to listen on for HTTP requests.")
flagMetricsFile = flag.String("metrics-file", "hue_metrics.json", "The JSON file with the metric definitions.") flagMetricsFile = flag.String("metrics-file", "hue_metrics.json", "The JSON file with the metric definitions.")
flagTest = flag.Bool("test", false, "test configured metrics") flagTest = flag.Bool("test", false, "Test configured metrics")
flagCollect = flag.Bool("collect", false, "test configured metrics") flagCollect = flag.Bool("collect", false, "Collect all available metrics")
flagCollectFile = flag.String("collect-file", "", "The JSON file where to store collect results") flagCollectFile = flag.String("collect-file", "", "The JSON file where to store collect results")
) )