Merge pull request #476 from unpoller/fix-422-part-2
Fixes another NPE for UXG data missing on some replies
This commit is contained in:
commit
d90056ecec
|
|
@ -30,6 +30,10 @@ func (u *DatadogUnifi) batchUXG(r report, s *unifi.UXG) { // nolint: funlen
|
||||||
if s.Stat != nil {
|
if s.Stat != nil {
|
||||||
gw = s.Stat.Gw
|
gw = s.Stat.Gw
|
||||||
}
|
}
|
||||||
|
var sw *unifi.Sw = nil
|
||||||
|
if s.Stat != nil {
|
||||||
|
sw = s.Stat.Sw
|
||||||
|
}
|
||||||
data := CombineFloat64(
|
data := CombineFloat64(
|
||||||
u.batchUDMstorage(s.Storage),
|
u.batchUDMstorage(s.Storage),
|
||||||
u.batchUDMtemps(s.Temperatures),
|
u.batchUDMtemps(s.Temperatures),
|
||||||
|
|
@ -70,7 +74,7 @@ func (u *DatadogUnifi) batchUXG(r report, s *unifi.UXG) { // nolint: funlen
|
||||||
"ip": s.IP,
|
"ip": s.IP,
|
||||||
})
|
})
|
||||||
data = CombineFloat64(
|
data = CombineFloat64(
|
||||||
u.batchUSWstat(s.Stat.Sw),
|
u.batchUSWstat(sw),
|
||||||
map[string]float64{
|
map[string]float64{
|
||||||
"guest_num_sta": s.GuestNumSta.Val,
|
"guest_num_sta": s.GuestNumSta.Val,
|
||||||
"bytes": s.Bytes.Val,
|
"bytes": s.Bytes.Val,
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,10 @@ func (u *InfluxUnifi) batchUXG(r report, s *unifi.UXG) { // nolint: funlen
|
||||||
if s.Stat != nil {
|
if s.Stat != nil {
|
||||||
gw = s.Stat.Gw
|
gw = s.Stat.Gw
|
||||||
}
|
}
|
||||||
|
var sw *unifi.Sw = nil
|
||||||
|
if s.Stat != nil {
|
||||||
|
sw = s.Stat.Sw
|
||||||
|
}
|
||||||
fields := Combine(
|
fields := Combine(
|
||||||
u.batchUDMstorage(s.Storage),
|
u.batchUDMstorage(s.Storage),
|
||||||
u.batchUDMtemps(s.Temperatures),
|
u.batchUDMtemps(s.Temperatures),
|
||||||
|
|
@ -68,7 +72,7 @@ func (u *InfluxUnifi) batchUXG(r report, s *unifi.UXG) { // nolint: funlen
|
||||||
"type": s.Type,
|
"type": s.Type,
|
||||||
}
|
}
|
||||||
fields = Combine(
|
fields = Combine(
|
||||||
u.batchUSWstat(s.Stat.Sw),
|
u.batchUSWstat(sw),
|
||||||
map[string]any{
|
map[string]any{
|
||||||
"guest-num_sta": s.GuestNumSta.Val,
|
"guest-num_sta": s.GuestNumSta.Val,
|
||||||
"ip": s.IP,
|
"ip": s.IP,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue