diff --git a/pkg/promunifi/uap.go b/pkg/promunifi/uap.go index c537632e..108fea3f 100644 --- a/pkg/promunifi/uap.go +++ b/pkg/promunifi/uap.go @@ -161,11 +161,11 @@ func descUAP(ns string) *uap { func (u *promUnifi) exportUAP(r report, d *unifi.UAP) { labels := []string{d.Type, d.SiteName, d.Name} - infoLabels := []string{d.Version, d.Model, d.Serial, d.Mac} + infoLabels := []string{d.Version, d.Model, d.Serial, d.Mac, d.IP, d.ID, d.Bytes.Txt} + // Wireless System Data. r.send([]*metric{ {u.Device.Info, prometheus.GaugeValue, d.Uptime, append(labels, infoLabels...)}, - {u.Device.Uptime, prometheus.GaugeValue, d.Uptime, labels}, {u.Device.TotalTxBytes, prometheus.CounterValue, d.TxBytes, labels}, {u.Device.TotalRxBytes, prometheus.CounterValue, d.RxBytes, labels}, {u.Device.TotalBytes, prometheus.CounterValue, d.Bytes, labels}, diff --git a/pkg/promunifi/udm.go b/pkg/promunifi/udm.go index 53ade3ac..83202df1 100644 --- a/pkg/promunifi/udm.go +++ b/pkg/promunifi/udm.go @@ -7,8 +7,7 @@ import ( // These are shared by all four device types: UDM, UAP, USG, USW type unifiDevice struct { - Info *prometheus.Desc - Uptime *prometheus.Desc + Info *prometheus.Desc // uptime Temperature *prometheus.Desc // sw only TotalMaxPower *prometheus.Desc // sw only FanLevel *prometheus.Desc // sw only @@ -36,10 +35,9 @@ type unifiDevice struct { func descDevice(ns string) *unifiDevice { labels := []string{"type", "site_name", "name"} - infoLabels := []string{"version", "model", "serial", "mac"} + infoLabels := []string{"version", "model", "serial", "mac", "ip", "id", "bytes"} return &unifiDevice{ Info: prometheus.NewDesc(ns+"info", "Device Information", append(labels, infoLabels...), nil), - Uptime: prometheus.NewDesc(ns+"uptime", "Uptime", labels, nil), Temperature: prometheus.NewDesc(ns+"temperature_celsius", "Temperature", labels, nil), TotalMaxPower: prometheus.NewDesc(ns+"max_power_total", "Total Max Power", labels, nil), FanLevel: prometheus.NewDesc(ns+"fan_level", "Fan Level", labels, nil), @@ -69,13 +67,12 @@ func descDevice(ns string) *unifiDevice { // UDM is a collection of stats from USG, USW and UAP. It has no unique stats. func (u *promUnifi) exportUDM(r report, d *unifi.UDM) { labels := []string{d.Type, d.SiteName, d.Name} - infoLabels := []string{d.Version, d.Model, d.Serial, d.Mac} + infoLabels := []string{d.Version, d.Model, d.Serial, d.Mac, d.IP, d.ID, d.Bytes.Txt} labelsGuest := append(labels, "guest") labelsUser := append(labels, "user") // Dream Machine System Data. r.send([]*metric{ {u.Device.Info, prometheus.GaugeValue, d.Uptime, append(labels, infoLabels...)}, - {u.Device.Uptime, prometheus.GaugeValue, d.Uptime, labels}, {u.Device.TotalTxBytes, prometheus.CounterValue, d.TxBytes, labels}, {u.Device.TotalRxBytes, prometheus.CounterValue, d.RxBytes, labels}, {u.Device.TotalBytes, prometheus.CounterValue, d.Bytes, labels}, diff --git a/pkg/promunifi/usg.go b/pkg/promunifi/usg.go index abc09bbe..03c6a12f 100644 --- a/pkg/promunifi/usg.go +++ b/pkg/promunifi/usg.go @@ -72,13 +72,12 @@ func descUSG(ns string) *usg { func (u *promUnifi) exportUSG(r report, d *unifi.USG) { labels := []string{d.Type, d.SiteName, d.Name} - infoLabels := []string{d.Version, d.Model, d.Serial, d.Mac} + infoLabels := []string{d.Version, d.Model, d.Serial, d.Mac, d.IP, d.ID, d.Bytes.Txt} labelsUser := append(labels, "user") labelsGuest := append(labels, "guest") // Gateway System Data. r.send([]*metric{ {u.Device.Info, prometheus.GaugeValue, d.Uptime, append(labels, infoLabels...)}, - {u.Device.Uptime, prometheus.GaugeValue, d.Uptime, labels}, {u.Device.TotalTxBytes, prometheus.CounterValue, d.TxBytes, labels}, {u.Device.TotalRxBytes, prometheus.CounterValue, d.RxBytes, labels}, {u.Device.TotalBytes, prometheus.CounterValue, d.Bytes, labels}, diff --git a/pkg/promunifi/usw.go b/pkg/promunifi/usw.go index 76e0f737..034b52db 100644 --- a/pkg/promunifi/usw.go +++ b/pkg/promunifi/usw.go @@ -93,7 +93,7 @@ func descUSW(ns string) *usw { func (u *promUnifi) exportUSW(r report, d *unifi.USW) { labels := []string{d.Type, d.SiteName, d.Name} - infoLabels := []string{d.Version, d.Model, d.Serial, d.Mac} + infoLabels := []string{d.Version, d.Model, d.Serial, d.Mac, d.IP, d.ID, d.Bytes.Txt} labelsGuest := append(labels, "guest") labelsUser := append(labels, "user") if d.HasTemperature.Val { @@ -106,7 +106,6 @@ func (u *promUnifi) exportUSW(r report, d *unifi.USW) { // Switch System Data. r.send([]*metric{ {u.Device.Info, prometheus.GaugeValue, d.Uptime, append(labels, infoLabels...)}, - {u.Device.Uptime, prometheus.GaugeValue, d.Uptime, labels}, {u.Device.TotalMaxPower, prometheus.GaugeValue, d.TotalMaxPower, labels}, {u.Device.TotalTxBytes, prometheus.CounterValue, d.TxBytes, labels}, {u.Device.TotalRxBytes, prometheus.CounterValue, d.RxBytes, labels},