From 2b185e88c7436480670f6ed6a2e09f287e069c6a Mon Sep 17 00:00:00 2001 From: Cody Lee Date: Mon, 23 Jan 2023 17:32:14 -0600 Subject: [PATCH] fixes sitedpi strings on influx and prom --- pkg/influxunifi/site.go | 8 ++++---- pkg/promunifi/site.go | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/influxunifi/site.go b/pkg/influxunifi/site.go index f049472f..b6e044ac 100644 --- a/pkg/influxunifi/site.go +++ b/pkg/influxunifi/site.go @@ -74,10 +74,10 @@ func (u *InfluxUnifi) batchSiteDPI(r report, v any) { "source": s.SourceName, }, Fields: map[string]any{ - "tx_packets": dpi.TxPackets, - "rx_packets": dpi.RxPackets, - "tx_bytes": dpi.TxBytes, - "rx_bytes": dpi.RxBytes, + "tx_packets": dpi.TxPackets.Val, + "rx_packets": dpi.RxPackets.Val, + "tx_bytes": dpi.TxBytes.Val, + "rx_bytes": dpi.RxBytes.Val, }, }) } diff --git a/pkg/promunifi/site.go b/pkg/promunifi/site.go index 871beb4e..7c58ef84 100644 --- a/pkg/promunifi/site.go +++ b/pkg/promunifi/site.go @@ -87,10 +87,10 @@ func (u *promUnifi) exportSiteDPI(r report, v any) { // log.Println(labelsDPI, dpi.Cat, dpi.App, dpi.TxBytes, dpi.RxBytes, dpi.TxPackets, dpi.RxPackets) r.send([]*metric{ - {u.Site.DPITxPackets, gauge, dpi.TxPackets, labelDPI}, - {u.Site.DPIRxPackets, gauge, dpi.RxPackets, labelDPI}, - {u.Site.DPITxBytes, gauge, dpi.TxBytes, labelDPI}, - {u.Site.DPIRxBytes, gauge, dpi.RxBytes, labelDPI}, + {u.Site.DPITxPackets, gauge, dpi.TxPackets.Val, labelDPI}, + {u.Site.DPIRxPackets, gauge, dpi.RxPackets.Val, labelDPI}, + {u.Site.DPITxBytes, gauge, dpi.TxBytes.Val, labelDPI}, + {u.Site.DPIRxBytes, gauge, dpi.RxBytes.Val, labelDPI}, }) } }