create gateway nodeid by removing : in mac

Signed-off-by: Florian Maurer <f.maurer@outlook.de>
This commit is contained in:
Florian Maurer 2023-09-19 09:11:35 +02:00
parent 61ed2208c6
commit ce816d67ea
No known key found for this signature in database
GPG Key ID: D5B29CD0C9E06237
1 changed files with 3 additions and 2 deletions

View File

@ -4,6 +4,7 @@ import (
"fmt" "fmt"
"log" "log"
"strconv" "strconv"
"strings"
"time" "time"
models "github.com/influxdata/influxdb1-client/models" 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))) tags.SetString("frequency"+suffix, strconv.Itoa(int(airtime.Frequency)))
} }
// Add selected gateway mac as tag // Add selected gateway mac as tag
tags.SetString("gateway", stats.GatewayIPv4) tags.SetString("gateway", strings.ReplaceAll(stats.GatewayIPv4, ":", ""))
tags.SetString("gateway6", stats.GatewayIPv6) tags.SetString("gateway6", strings.ReplaceAll(stats.GatewayIPv6, ":", ""))
conn.addPoint(MeasurementNode, tags, fields, time) conn.addPoint(MeasurementNode, tags, fields, time)
// Add DHCP statistics // Add DHCP statistics