Fix bugs in uap collection.
This commit is contained in:
parent
258c97fa79
commit
cf879d8377
|
|
@ -222,41 +222,41 @@ func (u UAP) Points() ([]*influx.Point, error) {
|
||||||
fields["radio_tx_power"] = s.TxPower
|
fields["radio_tx_power"] = s.TxPower
|
||||||
fields["radio_tx_retries"] = s.TxRetries
|
fields["radio_tx_retries"] = s.TxRetries
|
||||||
fields["user-num_sta"] = s.UserNumSta
|
fields["user-num_sta"] = s.UserNumSta
|
||||||
continue
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for _, s := range u.VapTable {
|
for _, s := range u.VapTable {
|
||||||
if p.Name == s.RadioName {
|
if p.Name == s.RadioName {
|
||||||
tags["ap_mac"] = s.ApMac
|
tags["ap_mac"] = s.ApMac
|
||||||
tags["bssid"] = s.Bssid
|
tags["bssid"] = s.Bssid
|
||||||
|
tags["vap_id"] = s.ID
|
||||||
|
tags["vap_name"] = s.Name
|
||||||
|
tags["wlanconf_id"] = s.WlanconfID
|
||||||
fields["ccq"] = s.Ccq
|
fields["ccq"] = s.Ccq
|
||||||
fields["essid"] = s.Essid
|
fields["essid"] = s.Essid
|
||||||
fields["extchannel"] = s.Extchannel
|
fields["extchannel"] = s.Extchannel
|
||||||
tags["vap_id"] = s.ID
|
|
||||||
fields["is_guest"] = s.IsGuest
|
fields["is_guest"] = s.IsGuest
|
||||||
fields["is_wep"] = s.IsWep
|
fields["is_wep"] = s.IsWep
|
||||||
fields["mac_filter_rejections"] = s.MacFilterRejections
|
fields["mac_filter_rejections"] = s.MacFilterRejections
|
||||||
fields["map_id"] = s.MapID
|
fields["map_id"] = s.MapID
|
||||||
tags["vap_name"] = s.Name
|
fields["vap_rx_bytes"] = s.RxBytes
|
||||||
fields["rx_bytes"] = s.RxBytes
|
fields["vap_rx_crypts"] = s.RxCrypts
|
||||||
fields["rx_crypts"] = s.RxCrypts
|
fields["vap_rx_dropped"] = s.RxDropped
|
||||||
fields["rx_dropped"] = s.RxDropped
|
fields["vap_rx_errors"] = s.RxErrors
|
||||||
fields["rx_errors"] = s.RxErrors
|
fields["vap_rx_frags"] = s.RxFrags
|
||||||
fields["rx_frags"] = s.RxFrags
|
fields["vap_rx_nwids"] = s.RxNwids
|
||||||
fields["rx_nwids"] = s.RxNwids
|
fields["vap_rx_packets"] = s.RxPackets
|
||||||
fields["rx_packets"] = s.RxPackets
|
fields["vap_tx_bytes"] = s.TxBytes
|
||||||
fields["tx_bytes"] = s.TxBytes
|
fields["vap_tx_dropped"] = s.TxDropped
|
||||||
fields["tx_dropped"] = s.TxDropped
|
fields["vap_tx_errors"] = s.TxErrors
|
||||||
fields["tx_errors"] = s.TxErrors
|
fields["vap_tx_latency_avg"] = s.TxLatencyAvg
|
||||||
fields["tx_latency_avg"] = s.TxLatencyAvg
|
fields["vap_tx_latency_max"] = s.TxLatencyMax
|
||||||
fields["tx_latency_max"] = s.TxLatencyMax
|
fields["vap_tx_latency_min"] = s.TxLatencyMin
|
||||||
fields["tx_latency_min"] = s.TxLatencyMin
|
fields["vap_tx_packets"] = s.TxPackets
|
||||||
fields["tx_packets"] = s.TxPackets
|
fields["vap_tx_power"] = s.TxPower
|
||||||
fields["tx_power"] = s.TxPower
|
fields["vap_tx_retries"] = s.TxRetries
|
||||||
fields["tx_retries"] = s.TxRetries
|
|
||||||
fields["usage"] = s.Usage
|
fields["usage"] = s.Usage
|
||||||
tags["wlanconf_id"] = s.WlanconfID
|
break
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pt, err := influx.NewPoint("uap_radios", tags, fields, time.Now())
|
pt, err := influx.NewPoint("uap_radios", tags, fields, time.Now())
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ type FlexBool struct {
|
||||||
String string
|
String string
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSO method converts armed/disarmed, yes/no, active/inactive or 0/1 to true/false.
|
// UnmarshalJSON method converts armed/disarmed, yes/no, active/inactive or 0/1 to true/false.
|
||||||
// Really it converts ready, up, t, armed, yes, active, enabled, 1, true to true. Anything else is false.
|
// Really it converts ready, up, t, armed, yes, active, enabled, 1, true to true. Anything else is false.
|
||||||
func (f *FlexBool) UnmarshalJSON(b []byte) error {
|
func (f *FlexBool) UnmarshalJSON(b []byte) error {
|
||||||
f.String = strings.Trim(string(b), `"`)
|
f.String = strings.Trim(string(b), `"`)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue