add more temps for USG
This commit is contained in:
parent
51abe6e9b0
commit
884cf4f2e2
|
|
@ -6,6 +6,6 @@ require (
|
||||||
github.com/prometheus/client_golang v1.9.0
|
github.com/prometheus/client_golang v1.9.0
|
||||||
github.com/prometheus/common v0.18.0
|
github.com/prometheus/common v0.18.0
|
||||||
github.com/unifi-poller/poller v0.0.8
|
github.com/unifi-poller/poller v0.0.8
|
||||||
github.com/unifi-poller/unifi v0.0.7-0.20210315003727-a4802cb45269
|
github.com/unifi-poller/unifi v0.0.7-0.20210315051727-4c317f9a2b95
|
||||||
github.com/unifi-poller/webserver v0.0.0-20200628212441-340749c94743
|
github.com/unifi-poller/webserver v0.0.0-20200628212441-340749c94743
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
package promunifi
|
package promunifi
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
"github.com/unifi-poller/unifi"
|
"github.com/unifi-poller/unifi"
|
||||||
)
|
)
|
||||||
|
|
@ -83,6 +86,15 @@ func (u *promUnifi) exportUSG(r report, d *unifi.USG) {
|
||||||
r.send([]*metric{{u.Device.Temperature, gauge, t.Value, append(labels, t.Name, t.Type)}})
|
r.send([]*metric{{u.Device.Temperature, gauge, t.Value, append(labels, t.Name, t.Type)}})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for k, v := range d.SystemStats.Temps {
|
||||||
|
temp, _ := strconv.ParseInt(strings.Split(v, " ")[0], 10, 64)
|
||||||
|
k = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(k, " ", "_"), ")", ""), "(", "")
|
||||||
|
|
||||||
|
if k = strings.ToLower(k); temp != 0 && k != "" {
|
||||||
|
r.send([]*metric{{u.Device.Temperature, gauge, temp, append(labels, k, k)}})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Gateway System Data.
|
// Gateway System Data.
|
||||||
u.exportWANPorts(r, labels, d.Wan1, d.Wan2)
|
u.exportWANPorts(r, labels, d.Wan1, d.Wan2)
|
||||||
u.exportBYTstats(r, labels, d.TxBytes, d.RxBytes)
|
u.exportBYTstats(r, labels, d.TxBytes, d.RxBytes)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue