put all port data in one place
This commit is contained in:
parent
0a9385924f
commit
ffbdbdbfd5
|
|
@ -35,7 +35,7 @@ func (u *InfluxUnifi) batchUAP(r report, s *unifi.UAP) {
|
|||
r.send(&metric{Table: "uap", Tags: tags, Fields: fields})
|
||||
u.processRadTable(r, tags, s.RadioTable, s.RadioTableStats)
|
||||
u.processVAPTable(r, tags, s.VapTable)
|
||||
u.batchPortTable(r, tags, "uap", s.PortTable)
|
||||
u.batchPortTable(r, tags, s.PortTable)
|
||||
}
|
||||
|
||||
func (u *InfluxUnifi) processUAPstats(ap *unifi.Ap) map[string]interface{} {
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ func (u *InfluxUnifi) batchUDM(r report, s *unifi.UDM) { // nolint: funlen
|
|||
})
|
||||
|
||||
r.send(&metric{Table: "usw", Tags: tags, Fields: fields})
|
||||
u.batchPortTable(r, tags, "usw", s.PortTable) // udm has a usw in it.
|
||||
u.batchPortTable(r, tags, s.PortTable) // udm has a usw in it.
|
||||
|
||||
if s.Stat.Ap == nil {
|
||||
return // we're done now. the following code process UDM (non-pro) UAP data.
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ func (u *InfluxUnifi) batchUSW(r report, s *unifi.USW) {
|
|||
})
|
||||
|
||||
r.send(&metric{Table: "usw", Tags: tags, Fields: fields})
|
||||
u.batchPortTable(r, tags, "usw", s.PortTable)
|
||||
u.batchPortTable(r, tags, s.PortTable)
|
||||
}
|
||||
|
||||
func (u *InfluxUnifi) batchUSWstat(sw *unifi.Sw) map[string]interface{} {
|
||||
|
|
@ -63,7 +63,7 @@ func (u *InfluxUnifi) batchUSWstat(sw *unifi.Sw) map[string]interface{} {
|
|||
}
|
||||
}
|
||||
|
||||
func (u *InfluxUnifi) batchPortTable(r report, t map[string]string, dev string, pt []unifi.Port) {
|
||||
func (u *InfluxUnifi) batchPortTable(r report, t map[string]string, pt []unifi.Port) {
|
||||
for _, p := range pt {
|
||||
if !p.Up.Val || !p.Enable.Val {
|
||||
continue // only record UP ports.
|
||||
|
|
@ -109,6 +109,6 @@ func (u *InfluxUnifi) batchPortTable(r report, t map[string]string, dev string,
|
|||
fields["poe_voltage"] = p.PoeVoltage.Val
|
||||
}
|
||||
|
||||
r.send(&metric{Table: dev + "_ports", Tags: tags, Fields: fields})
|
||||
r.send(&metric{Table: "usw_ports", Tags: tags, Fields: fields})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue