Skip to content

Commit

Permalink
create gateway nodeid by removing : in mac
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Maurer <[email protected]>
  • Loading branch information
maurerle committed Sep 19, 2023
1 parent 61ed220 commit ce816d6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions database/influxdb/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"log"
"strconv"
"strings"
"time"

models "github.com/influxdata/influxdb1-client/models"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ce816d6

Please sign in to comment.