Implement minimal NUT client and use it instead of upsc

This commit is contained in:
Dominik Honnef
2016-12-27 23:22:48 +01:00
parent 6f026006c0
commit 2520206e7f
2 changed files with 152 additions and 33 deletions
+3 -2
View File
@@ -3,13 +3,14 @@ package main
import (
"net/http"
"honnef.co/go/nut"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"honnef.co/go/nut_exporter"
)
func main() {
c := nut_exporter.NewNUTCollector([]string{"main"}, nil)
c := nut.NewCollector([]string{"localhost"})
prometheus.MustRegister(c)
http.Handle("/metrics", promhttp.Handler())
http.ListenAndServe(":9999", nil)