feat(database/influxdb): add information if a node is a gateway to influxdb (#230)

Signed-off-by: Florian Maurer <f.maurer@outlook.de>
This commit is contained in:
Florian Maurer 2023-09-21 15:16:40 +02:00 committed by GitHub
parent 4660f21b61
commit c19c1aed1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 6 deletions

View File

@ -34,6 +34,7 @@ func (conn *Connection) InsertNode(node *runtime.Node) {
tags := models.Tags{}
tags.SetString("nodeid", stats.NodeID)
tags.SetString("is_gateway", strconv.FormatBool(node.IsGateway()))
fields := models.Fields{
"load": stats.LoadAverage,
@ -192,12 +193,6 @@ func (conn *Connection) InsertNode(node *runtime.Node) {
"leases.pruned": dhcp.LeasesPruned,
}
// Tags
tags.SetString("nodeid", stats.NodeID)
if nodeinfo := node.Nodeinfo; nodeinfo != nil {
tags.SetString("hostname", nodeinfo.Hostname)
}
conn.addPoint(MeasurementDHCP, tags, fields, time)
}
}