From 8175afd43b11e867f15ae93b2a81ad661d664e14 Mon Sep 17 00:00:00 2001 From: Geno Date: Wed, 15 Mar 2017 23:26:34 +0100 Subject: [PATCH] [TASK] Add model, firmware_base and firmware_relase tag to node statistics. (#43) Thank you to: lemoer git@irrelefant.net https://paste.irrelefant.net/Liengie9.txt --- models/node.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/models/node.go b/models/node.go index 76f4303..14023b6 100644 --- a/models/node.go +++ b/models/node.go @@ -44,6 +44,7 @@ func (node *Node) ToInflux() (tags imodels.Tags, fields imodels.Fields) { } if nodeinfo := node.Nodeinfo; nodeinfo != nil { + tags.SetString("hostname", nodeinfo.Hostname) if owner := nodeinfo.Owner; owner != nil { tags.SetString("owner", owner.Contact) } @@ -51,8 +52,11 @@ func (node *Node) ToInflux() (tags imodels.Tags, fields imodels.Fields) { fields["wireless.txpower24"] = wireless.TxPower24 fields["wireless.txpower5"] = wireless.TxPower5 } - // morpheus needs - tags.SetString("hostname", nodeinfo.Hostname) + // Hardware + tags.SetString("model", nodeinfo.Hardware.Model) + tags.SetString("firmware_base", nodeinfo.Software.Firmware.Base) + tags.SetString("firmware_release", nodeinfo.Software.Firmware.Release) + } if neighbours := node.Neighbours; neighbours != nil {