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:
parent
4660f21b61
commit
c19c1aed1b
|
@ -34,6 +34,7 @@ func (conn *Connection) InsertNode(node *runtime.Node) {
|
||||||
|
|
||||||
tags := models.Tags{}
|
tags := models.Tags{}
|
||||||
tags.SetString("nodeid", stats.NodeID)
|
tags.SetString("nodeid", stats.NodeID)
|
||||||
|
tags.SetString("is_gateway", strconv.FormatBool(node.IsGateway()))
|
||||||
|
|
||||||
fields := models.Fields{
|
fields := models.Fields{
|
||||||
"load": stats.LoadAverage,
|
"load": stats.LoadAverage,
|
||||||
|
@ -192,12 +193,6 @@ func (conn *Connection) InsertNode(node *runtime.Node) {
|
||||||
"leases.pruned": dhcp.LeasesPruned,
|
"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)
|
conn.addPoint(MeasurementDHCP, tags, fields, time)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue