From ce816d67eaf4a922df8f4cbd8d3165556bf92431 Mon Sep 17 00:00:00 2001 From: Florian Maurer Date: Tue, 19 Sep 2023 09:11:35 +0200 Subject: [PATCH] create gateway nodeid by removing : in mac Signed-off-by: Florian Maurer --- database/influxdb/node.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/database/influxdb/node.go b/database/influxdb/node.go index 07d3fcf..76b6f06 100644 --- a/database/influxdb/node.go +++ b/database/influxdb/node.go @@ -4,6 +4,7 @@ import ( "fmt" "log" "strconv" + "strings" "time" models "github.com/influxdata/influxdb1-client/models" @@ -174,8 +175,8 @@ func (conn *Connection) InsertNode(node *runtime.Node) { tags.SetString("frequency"+suffix, strconv.Itoa(int(airtime.Frequency))) } // Add selected gateway mac as tag - tags.SetString("gateway", stats.GatewayIPv4) - tags.SetString("gateway6", stats.GatewayIPv6) + tags.SetString("gateway", strings.ReplaceAll(stats.GatewayIPv4, ":", "")) + tags.SetString("gateway6", strings.ReplaceAll(stats.GatewayIPv6, ":", "")) conn.addPoint(MeasurementNode, tags, fields, time) // Add DHCP statistics