mirror of
https://github.com/rwinkhart/uni-nut.git
synced 2026-09-02 06:57:26 -04:00
Implement minimal NUT client and use it instead of upsc
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user