From cb788ec2741b2df1ec3f239cb7bd61efa91bf99a Mon Sep 17 00:00:00 2001 From: David Newhall II Date: Sun, 21 Mar 2021 21:34:50 -0700 Subject: [PATCH] fixes to rogue api saving --- integrations/influxunifi/uap.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/integrations/influxunifi/uap.go b/integrations/influxunifi/uap.go index f4d6d5b0..b289f4f1 100644 --- a/integrations/influxunifi/uap.go +++ b/integrations/influxunifi/uap.go @@ -9,6 +9,10 @@ const uapT = item("UAP") // batchRogueAP generates metric points for neighboring access points. func (u *InfluxUnifi) batchRogueAP(r report, s *unifi.RogueAP) { + if s.Age.Val == 0 { + return // only keep metrics for things that are recent. + } + r.send(&metric{ Table: "rogue_ap", Tags: map[string]string{ @@ -21,7 +25,7 @@ func (u *InfluxUnifi) batchRogueAP(r report, s *unifi.RogueAP) { "band": s.Band, }, Fields: map[string]interface{}{ - "age": s.Age, + "age": s.Age.Val, "bw": s.Bw.Val, "center_freq": s.CenterFreq.Val, "channel": s.Channel,