Add UDM support.
This commit is contained in:
parent
b49a0a37ea
commit
64ea35112d
|
|
@ -34,6 +34,12 @@ func (u *Unifi) parseDevices(data []json.RawMessage, siteName string) *Devices {
|
|||
dev.Name = pick(dev.Name, dev.Mac)
|
||||
devices.USWs = append(devices.USWs, dev)
|
||||
}
|
||||
case "udm":
|
||||
dev := &UDM{SiteName: siteName}
|
||||
if u.unmarshalDevice(assetType, r, dev) == nil {
|
||||
dev.Name = pick(dev.Name, dev.Mac)
|
||||
devices.UDMs = append(devices.UDMs, dev)
|
||||
}
|
||||
default:
|
||||
u.ErrorLog("unknown asset type - %v - skipping", assetType)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ type Devices struct {
|
|||
UAPs []*UAP
|
||||
USGs []*USG
|
||||
USWs []*USW
|
||||
UDMs []*UDM
|
||||
}
|
||||
|
||||
// Unifi is what you get in return for providing a password! Unifi represents
|
||||
|
|
|
|||
|
|
@ -64,15 +64,15 @@ func (u *UAP) PointsAt(now time.Time) ([]*influx.Point, error) {
|
|||
"user-num_sta": u.UserNumSta,
|
||||
"guest-num_sta": u.GuestNumSta,
|
||||
"version": u.Version,
|
||||
"loadavg_1": u.SysStats.Loadavg1,
|
||||
"loadavg_5": u.SysStats.Loadavg5,
|
||||
"loadavg_15": u.SysStats.Loadavg15,
|
||||
"loadavg_1": u.SysStats.Loadavg1.Val,
|
||||
"loadavg_5": u.SysStats.Loadavg5.Val,
|
||||
"loadavg_15": u.SysStats.Loadavg15.Val,
|
||||
"mem_buffer": u.SysStats.MemBuffer.Val,
|
||||
"mem_total": u.SysStats.MemTotal.Val,
|
||||
"mem_used": u.SysStats.MemUsed.Val,
|
||||
"cpu": u.SystemStats.CPU,
|
||||
"mem": u.SystemStats.Mem,
|
||||
"system_uptime": u.SystemStats.Uptime,
|
||||
"cpu": u.SystemStats.CPU.Val,
|
||||
"mem": u.SystemStats.Mem.Val,
|
||||
"system_uptime": u.SystemStats.Uptime.Val,
|
||||
"stat_guest-wifi0-rx_packets": u.Stat.GuestWifi0RxPackets.Val,
|
||||
"stat_guest-wifi1-rx_packets": u.Stat.GuestWifi1RxPackets.Val,
|
||||
"stat_user-wifi1-rx_packets": u.Stat.UserWifi1RxPackets.Val,
|
||||
|
|
|
|||
|
|
@ -44,26 +44,8 @@ type UAP struct {
|
|||
Model string `json:"model"`
|
||||
Name string `json:"name"`
|
||||
OutdoorModeOverride string `json:"outdoor_mode_override"`
|
||||
PortTable []struct {
|
||||
PortIdx FlexInt `json:"port_idx"`
|
||||
OpMode string `json:"op_mode"`
|
||||
PortconfID string `json:"portconf_id"`
|
||||
AttrNoEdit FlexBool `json:"attr_no_edit,omitempty"`
|
||||
Media string `json:"media"`
|
||||
Name string `json:"name"`
|
||||
PoeCaps FlexInt `json:"poe_caps"`
|
||||
PortPoe FlexBool `json:"port_poe"`
|
||||
TxBytesR FlexInt `json:"tx_bytes-r"`
|
||||
RxBytesR FlexInt `json:"rx_bytes-r"`
|
||||
BytesR FlexInt `json:"bytes-r"`
|
||||
PortDelta struct {
|
||||
TimeDelta FlexInt `json:"time_delta"`
|
||||
} `json:"port_delta"`
|
||||
Enable FlexBool `json:"enable"`
|
||||
Masked FlexBool `json:"masked"`
|
||||
AggregatedBy FlexBool `json:"aggregated_by"`
|
||||
} `json:"port_table"`
|
||||
RadioTable []struct {
|
||||
PortTable []Port `json:"port_table"`
|
||||
RadioTable []struct {
|
||||
Radio string `json:"radio"`
|
||||
Name string `json:"name"`
|
||||
Channel FlexInt `json:"channel"`
|
||||
|
|
@ -112,27 +94,16 @@ type UAP struct {
|
|||
Locating FlexBool `json:"locating"`
|
||||
ConnectRequestIP string `json:"connect_request_ip"`
|
||||
ConnectRequestPort string `json:"connect_request_port"`
|
||||
SysStats struct {
|
||||
Loadavg1 float64 `json:"loadavg_1,string"`
|
||||
Loadavg15 float64 `json:"loadavg_15,string"`
|
||||
Loadavg5 float64 `json:"loadavg_5,string"`
|
||||
MemBuffer FlexInt `json:"mem_buffer"`
|
||||
MemTotal FlexInt `json:"mem_total"`
|
||||
MemUsed FlexInt `json:"mem_used"`
|
||||
} `json:"sys_stats"`
|
||||
SystemStats struct {
|
||||
CPU float64 `json:"cpu,string"`
|
||||
Mem float64 `json:"mem,string"`
|
||||
Uptime float64 `json:"uptime,string"`
|
||||
} `json:"system-stats"`
|
||||
SSHSessionTable []interface{} `json:"ssh_session_table"`
|
||||
Scanning FlexBool `json:"scanning"`
|
||||
SpectrumScanning FlexBool `json:"spectrum_scanning"`
|
||||
GuestToken string `json:"guest_token"`
|
||||
Meshv3PeerMac string `json:"meshv3_peer_mac"`
|
||||
Satisfaction FlexInt `json:"satisfaction"`
|
||||
Isolated FlexBool `json:"isolated"`
|
||||
RadioTableStats []struct {
|
||||
SysStats SysStats `json:"sys_stats"`
|
||||
SystemStats SystemStats `json:"system-stats"`
|
||||
SSHSessionTable []interface{} `json:"ssh_session_table"`
|
||||
Scanning FlexBool `json:"scanning"`
|
||||
SpectrumScanning FlexBool `json:"spectrum_scanning"`
|
||||
GuestToken string `json:"guest_token"`
|
||||
Meshv3PeerMac string `json:"meshv3_peer_mac"`
|
||||
Satisfaction FlexInt `json:"satisfaction"`
|
||||
Isolated FlexBool `json:"isolated"`
|
||||
RadioTableStats []struct {
|
||||
Name string `json:"name"`
|
||||
Channel FlexInt `json:"channel"`
|
||||
Radio string `json:"radio"`
|
||||
|
|
|
|||
|
|
@ -0,0 +1,333 @@
|
|||
package unifi
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
influx "github.com/influxdata/influxdb1-client/v2"
|
||||
)
|
||||
|
||||
// Points generates Unifi Gateway datapoints for InfluxDB.
|
||||
// These points can be passed directly to influx.
|
||||
func (u *UDM) Points() ([]*influx.Point, error) {
|
||||
return u.PointsAt(time.Now())
|
||||
}
|
||||
|
||||
// PointsAt generates Unifi Gateway datapoints for InfluxDB.
|
||||
// These points can be passed directly to influx.
|
||||
// This is just like Points(), but specify when points were created.
|
||||
func (u *UDM) PointsAt(now time.Time) ([]*influx.Point, error) {
|
||||
if u.Stat.gw == nil {
|
||||
// Disabled devices lack stats.
|
||||
u.Stat.gw = &gw{}
|
||||
}
|
||||
if u.Stat.sw == nil {
|
||||
// Disabled devices lack stats.
|
||||
u.Stat.sw = &sw{}
|
||||
}
|
||||
tags := map[string]string{
|
||||
"id": u.ID,
|
||||
"mac": u.Mac,
|
||||
"device_oid": u.Stat.gw.Oid,
|
||||
"site_id": u.SiteID,
|
||||
"site_name": u.SiteName,
|
||||
"adopted": u.Adopted.Txt,
|
||||
"name": u.Name,
|
||||
"cfgversion": u.Cfgversion,
|
||||
"config_network_ip": u.ConfigNetwork.IP,
|
||||
"config_network_type": u.ConfigNetwork.Type,
|
||||
"connect_request_ip": u.ConnectRequestIP,
|
||||
"connect_request_port": u.ConnectRequestPort,
|
||||
"device_id": u.DeviceID,
|
||||
"guest_token": u.GuestToken,
|
||||
"inform_ip": u.InformIP,
|
||||
"known_cfgversion": u.KnownCfgversion,
|
||||
"model": u.Model,
|
||||
"serial": u.Serial,
|
||||
"type": u.Type,
|
||||
"usg_caps": u.UsgCaps.Txt,
|
||||
"speedtest-status-saved": u.SpeedtestStatusSaved.Txt,
|
||||
"wan1_up": u.Wan1.Up.Txt,
|
||||
"wan2_up": u.Wan2.Up.Txt,
|
||||
}
|
||||
fields := map[string]interface{}{
|
||||
"ip": u.IP,
|
||||
"bytes": u.Bytes.Val,
|
||||
"last_seen": u.LastSeen.Val,
|
||||
"license_state": u.LicenseState,
|
||||
"fw_caps": u.FwCaps.Val,
|
||||
"guest-num_sta": u.GuestNumSta.Val,
|
||||
"rx_bytes": u.RxBytes.Val,
|
||||
"tx_bytes": u.TxBytes.Val,
|
||||
"uptime": u.Uptime.Val,
|
||||
"state": u.State.Val,
|
||||
"user-num_sta": u.UserNumSta.Val,
|
||||
"version": u.Version,
|
||||
"num_desktop": u.NumDesktop.Val,
|
||||
"num_handheld": u.NumHandheld.Val,
|
||||
"num_mobile": u.NumMobile.Val,
|
||||
"speedtest-status_latency": u.SpeedtestStatus.Latency.Val,
|
||||
"speedtest-status_rundate": u.SpeedtestStatus.Rundate.Val,
|
||||
"speedtest-status_runtime": u.SpeedtestStatus.Runtime.Val,
|
||||
"speedtest-status_download": u.SpeedtestStatus.StatusDownload.Val,
|
||||
"speedtest-status_ping": u.SpeedtestStatus.StatusPing.Val,
|
||||
"speedtest-status_summary": u.SpeedtestStatus.StatusSummary.Val,
|
||||
"speedtest-status_upload": u.SpeedtestStatus.StatusUpload.Val,
|
||||
"speedtest-status_xput_download": u.SpeedtestStatus.XputDownload.Val,
|
||||
"speedtest-status_xput_upload": u.SpeedtestStatus.XputUpload.Val,
|
||||
"config_network_wan_type": u.ConfigNetwork.Type,
|
||||
"wan1_bytes-r": u.Wan1.BytesR.Val,
|
||||
"wan1_enable": u.Wan1.Enable.Val,
|
||||
"wan1_full_duplex": u.Wan1.FullDuplex.Val,
|
||||
"wan1_gateway": u.Wan1.Gateway,
|
||||
"wan1_ifname": u.Wan1.Ifname,
|
||||
"wan1_ip": u.Wan1.IP,
|
||||
"wan1_mac": u.Wan1.Mac,
|
||||
"wan1_max_speed": u.Wan1.MaxSpeed.Val,
|
||||
"wan1_name": u.Wan1.Name,
|
||||
"wan1_netmask": u.Wan1.Netmask,
|
||||
"wan1_rx_bytes": u.Wan1.RxBytes.Val,
|
||||
"wan1_rx_bytes-r": u.Wan1.RxBytesR.Val,
|
||||
"wan1_rx_dropped": u.Wan1.RxDropped.Val,
|
||||
"wan1_rx_errors": u.Wan1.RxErrors.Val,
|
||||
"wan1_rx_multicast": u.Wan1.RxMulticast.Val,
|
||||
"wan1_rx_packets": u.Wan1.RxPackets.Val,
|
||||
"wan1_type": u.Wan1.Type,
|
||||
"wan1_speed": u.Wan1.Speed.Val,
|
||||
"wan1_up": u.Wan1.Up.Val,
|
||||
"wan1_tx_bytes": u.Wan1.TxBytes.Val,
|
||||
"wan1_tx_bytes-r": u.Wan1.TxBytesR.Val,
|
||||
"wan1_tx_dropped": u.Wan1.TxDropped.Val,
|
||||
"wan1_tx_errors": u.Wan1.TxErrors.Val,
|
||||
"wan1_tx_packets": u.Wan1.TxPackets.Val,
|
||||
"wan2_bytes-r": u.Wan2.BytesR.Val,
|
||||
"wan2_enable": u.Wan2.Enable.Val,
|
||||
"wan2_full_duplex": u.Wan2.FullDuplex.Val,
|
||||
"wan2_gateway": u.Wan2.Gateway,
|
||||
"wan2_ifname": u.Wan2.Ifname,
|
||||
"wan2_ip": u.Wan2.IP,
|
||||
"wan2_mac": u.Wan2.Mac,
|
||||
"wan2_max_speed": u.Wan2.MaxSpeed.Val,
|
||||
"wan2_name": u.Wan2.Name,
|
||||
"wan2_netmask": u.Wan2.Netmask,
|
||||
"wan2_rx_bytes": u.Wan2.RxBytes.Val,
|
||||
"wan2_rx_bytes-r": u.Wan2.RxBytesR.Val,
|
||||
"wan2_rx_dropped": u.Wan2.RxDropped.Val,
|
||||
"wan2_rx_errors": u.Wan2.RxErrors.Val,
|
||||
"wan2_rx_multicast": u.Wan2.RxMulticast.Val,
|
||||
"wan2_rx_packets": u.Wan2.RxPackets.Val,
|
||||
"wan2_type": u.Wan2.Type,
|
||||
"wan2_speed": u.Wan2.Speed.Val,
|
||||
"wan2_up": u.Wan2.Up.Val,
|
||||
"wan2_tx_bytes": u.Wan2.TxBytes.Val,
|
||||
"wan2_tx_bytes-r": u.Wan2.TxBytesR.Val,
|
||||
"wan2_tx_dropped": u.Wan2.TxDropped.Val,
|
||||
"wan2_tx_errors": u.Wan2.TxErrors.Val,
|
||||
"wan2_tx_packets": u.Wan2.TxPackets.Val,
|
||||
"loadavg_1": u.SysStats.Loadavg1.Val,
|
||||
"loadavg_5": u.SysStats.Loadavg5.Val,
|
||||
"loadavg_15": u.SysStats.Loadavg15.Val,
|
||||
"mem_used": u.SysStats.MemUsed.Val,
|
||||
"mem_buffer": u.SysStats.MemBuffer.Val,
|
||||
"mem_total": u.SysStats.MemTotal.Val,
|
||||
"cpu": u.SystemStats.CPU.Val,
|
||||
"mem": u.SystemStats.Mem.Val,
|
||||
"system_uptime": u.SystemStats.Uptime.Val,
|
||||
"gw": u.Stat.Gw,
|
||||
"lan-rx_bytes": u.Stat.LanRxBytes.Val,
|
||||
"lan-rx_packets": u.Stat.LanRxPackets.Val,
|
||||
"lan-tx_bytes": u.Stat.LanTxBytes.Val,
|
||||
"lan-tx_packets": u.Stat.LanTxPackets.Val,
|
||||
"wan-rx_bytes": u.Stat.WanRxBytes.Val,
|
||||
"wan-rx_dropped": u.Stat.WanRxDropped.Val,
|
||||
"wan-rx_packets": u.Stat.WanRxPackets.Val,
|
||||
"wan-tx_bytes": u.Stat.WanTxBytes.Val,
|
||||
"wan-tx_packets": u.Stat.WanTxPackets.Val,
|
||||
"uplink_name": u.Uplink.Name,
|
||||
"uplink_latency": u.Uplink.Latency.Val,
|
||||
"uplink_speed": u.Uplink.Speed.Val,
|
||||
"uplink_num_ports": u.Uplink.NumPort.Val,
|
||||
"uplink_max_speed": u.Uplink.MaxSpeed.Val,
|
||||
}
|
||||
pt, err := influx.NewPoint("usg", tags, fields, now)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
points := []*influx.Point{pt}
|
||||
tags = map[string]string{
|
||||
"id": u.ID,
|
||||
"mac": u.Mac,
|
||||
"device_oid": u.Stat.sw.Oid,
|
||||
"site_id": u.SiteID,
|
||||
"site_name": u.SiteName,
|
||||
"name": u.Name,
|
||||
"adopted": u.Adopted.Txt,
|
||||
"cfgversion": u.Cfgversion,
|
||||
"config_network_ip": u.ConfigNetwork.IP,
|
||||
"config_network_type": u.ConfigNetwork.Type,
|
||||
"device_id": u.DeviceID,
|
||||
"inform_ip": u.InformIP,
|
||||
"known_cfgversion": u.KnownCfgversion,
|
||||
"locating": u.Locating.Txt,
|
||||
"model": u.Model,
|
||||
"serial": u.Serial,
|
||||
"type": u.Type,
|
||||
"dot1x_portctrl_enabled": u.Dot1XPortctrlEnabled.Txt,
|
||||
"flowctrl_enabled": u.FlowctrlEnabled.Txt,
|
||||
"has_fan": u.HasFan.Txt,
|
||||
"has_temperature": u.HasTemperature.Txt,
|
||||
"jumboframe_enabled": u.JumboframeEnabled.Txt,
|
||||
"stp_priority": u.StpPriority,
|
||||
"stp_version": u.StpVersion,
|
||||
}
|
||||
fields = map[string]interface{}{
|
||||
"fw_caps": u.FwCaps.Val,
|
||||
"guest-num_sta": u.GuestNumSta.Val,
|
||||
"ip": u.IP,
|
||||
"bytes": u.Bytes.Val,
|
||||
"fan_level": float64(0),
|
||||
"general_temperature": float64(0),
|
||||
"last_seen": u.LastSeen.Val,
|
||||
"license_state": u.LicenseState,
|
||||
"overheating": u.Overheating.Val,
|
||||
"rx_bytes": u.RxBytes.Val,
|
||||
"tx_bytes": u.TxBytes.Val,
|
||||
"uptime": u.Uptime.Val,
|
||||
"state": u.State.Val,
|
||||
"user-num_sta": u.UserNumSta.Val,
|
||||
"version": u.Version,
|
||||
"loadavg_1": u.SysStats.Loadavg1.Val,
|
||||
"loadavg_5": u.SysStats.Loadavg5.Val,
|
||||
"loadavg_15": u.SysStats.Loadavg15.Val,
|
||||
"mem_buffer": u.SysStats.MemBuffer.Val,
|
||||
"mem_used": u.SysStats.MemUsed.Val,
|
||||
"mem_total": u.SysStats.MemTotal.Val,
|
||||
"cpu": u.SystemStats.CPU.Val,
|
||||
"mem": u.SystemStats.Mem.Val,
|
||||
"system_uptime": u.SystemStats.Uptime.Val,
|
||||
"stat_bytes": u.Stat.Bytes.Val,
|
||||
"stat_rx_bytes": u.Stat.RxBytes.Val,
|
||||
"stat_rx_crypts": u.Stat.RxCrypts.Val,
|
||||
"stat_rx_dropped": u.Stat.RxDropped.Val,
|
||||
"stat_rx_errors": u.Stat.RxErrors.Val,
|
||||
"stat_rx_frags": u.Stat.RxFrags.Val,
|
||||
"stat_rx_packets": u.Stat.TxPackets.Val,
|
||||
"stat_tx_bytes": u.Stat.TxBytes.Val,
|
||||
"stat_tx_dropped": u.Stat.TxDropped.Val,
|
||||
"stat_tx_errors": u.Stat.TxErrors.Val,
|
||||
"stat_tx_packets": u.Stat.TxPackets.Val,
|
||||
"stat_tx_retries": u.Stat.TxRetries.Val,
|
||||
"uplink_depth": "0",
|
||||
}
|
||||
pt, err = influx.NewPoint("usw", tags, fields, now)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
points = append(points, pt)
|
||||
|
||||
for _, p := range u.NetworkTable {
|
||||
tags := map[string]string{
|
||||
"device_name": u.Name,
|
||||
"device_id": u.ID,
|
||||
"device_mac": u.Mac,
|
||||
"site_name": u.SiteName,
|
||||
"up": p.Up.Txt,
|
||||
"dhcpd_dns_enabled": p.DhcpdDNSEnabled.Txt,
|
||||
"dhcpd_enabled": p.DhcpdEnabled.Txt,
|
||||
"dhcpd_time_offset_enabled": p.DhcpdTimeOffsetEnabled.Txt,
|
||||
"dhcp_relay_enabledy": p.DhcpRelayEnabled.Txt,
|
||||
"dhcpd_gateway_enabled": p.DhcpdGatewayEnabled.Txt,
|
||||
"enabled": p.Enabled.Txt,
|
||||
"vlan_enabled": p.VlanEnabled.Txt,
|
||||
"attr_no_delete": p.AttrNoDelete.Txt,
|
||||
"is_guest": p.IsGuest.Txt,
|
||||
"is_nat": p.IsNat.Txt,
|
||||
"networkgroup": p.Networkgroup,
|
||||
"site_id": p.SiteID,
|
||||
}
|
||||
fields := map[string]interface{}{
|
||||
"domain_name": p.DomainName,
|
||||
"dhcpd_start": p.DhcpdStart,
|
||||
"dhcpd_stop": p.DhcpdStop,
|
||||
"ip": p.IP,
|
||||
"ip_subnet": p.IPSubnet,
|
||||
"mac": p.Mac,
|
||||
"name": p.Name,
|
||||
"num_sta": p.NumSta.Val,
|
||||
"purpose": p.Purpose,
|
||||
"rx_bytes": p.RxBytes.Val,
|
||||
"rx_packets": p.RxPackets.Val,
|
||||
"tx_bytes": p.TxBytes.Val,
|
||||
"tx_packets": p.TxPackets.Val,
|
||||
"ipv6_interface_type": p.Ipv6InterfaceType,
|
||||
"attr_hidden_id": p.AttrHiddenID,
|
||||
}
|
||||
pt, err = influx.NewPoint("usg_networks", tags, fields, now)
|
||||
if err != nil {
|
||||
return points, err
|
||||
}
|
||||
points = append(points, pt)
|
||||
}
|
||||
|
||||
for _, p := range u.PortTable {
|
||||
tags := map[string]string{
|
||||
"site_id": u.SiteID,
|
||||
"site_name": u.SiteName,
|
||||
"device_name": u.Name,
|
||||
"name": p.Name,
|
||||
"enable": p.Enable.Txt,
|
||||
"is_uplink": p.IsUplink.Txt,
|
||||
"up": p.Up.Txt,
|
||||
"portconf_id": p.PortconfID,
|
||||
"dot1x_mode": p.Dot1XMode,
|
||||
"dot1x_status": p.Dot1XStatus,
|
||||
"stp_state": p.StpState,
|
||||
"sfp_found": p.SfpFound.Txt,
|
||||
"op_mode": p.OpMode,
|
||||
"poe_mode": p.PoeMode,
|
||||
"port_poe": p.PortPoe.Txt,
|
||||
"port_idx": p.PortIdx.Txt,
|
||||
"port_id": u.Name + " Port " + p.PortIdx.Txt,
|
||||
"poe_enable": p.PoeEnable.Txt,
|
||||
"flowctrl_rx": p.FlowctrlRx.Txt,
|
||||
"flowctrl_tx": p.FlowctrlTx.Txt,
|
||||
"autoneg": p.Autoneg.Txt,
|
||||
"full_duplex": p.FullDuplex.Txt,
|
||||
"jumbo": p.Jumbo.Txt,
|
||||
"masked": p.Masked.Txt,
|
||||
"poe_good": p.PoeGood.Txt,
|
||||
"media": p.Media,
|
||||
"poe_class": p.PoeClass,
|
||||
"poe_caps": p.PoeCaps.Txt,
|
||||
"aggregated_by": p.AggregatedBy.Txt,
|
||||
}
|
||||
fields := map[string]interface{}{
|
||||
"dbytes_r": p.BytesR.Val,
|
||||
"rx_broadcast": p.RxBroadcast.Val,
|
||||
"rx_bytes": p.RxBytes.Val,
|
||||
"rx_bytes-r": p.RxBytesR.Val,
|
||||
"rx_dropped": p.RxDropped.Val,
|
||||
"rx_errors": p.RxErrors.Val,
|
||||
"rx_multicast": p.RxMulticast.Val,
|
||||
"rx_packets": p.RxPackets.Val,
|
||||
"speed": p.Speed.Val,
|
||||
"stp_pathcost": p.StpPathcost.Val,
|
||||
"tx_broadcast": p.TxBroadcast.Val,
|
||||
"tx_bytes": p.TxBytes.Val,
|
||||
"tx_bytes-r": p.TxBytesR.Val,
|
||||
"tx_dropped": p.TxDropped.Val,
|
||||
"tx_errors": p.TxErrors.Val,
|
||||
"tx_multicast": p.TxMulticast.Val,
|
||||
"tx_packets": p.TxPackets.Val,
|
||||
"poe_current": p.PoeCurrent.Val,
|
||||
"poe_power": p.PoePower.Val,
|
||||
"poe_voltage": p.PoeVoltage.Val,
|
||||
"full_duplex": p.FullDuplex.Val,
|
||||
}
|
||||
pt, err = influx.NewPoint("usw_ports", tags, fields, now)
|
||||
if err != nil {
|
||||
return points, err
|
||||
}
|
||||
points = append(points, pt)
|
||||
}
|
||||
return points, nil
|
||||
}
|
||||
|
|
@ -0,0 +1,185 @@
|
|||
package unifi
|
||||
|
||||
// UDM represents all the data from the Ubiquiti Controller for a Unifi Dream Machine.
|
||||
// The UDM shares several structs/type-data with USW and USG.
|
||||
type UDM struct {
|
||||
SiteID string `json:"site_id"`
|
||||
SiteName string `json:"-"`
|
||||
Mac string `json:"mac"`
|
||||
Adopted FlexBool `json:"adopted"`
|
||||
Serial string `json:"serial"`
|
||||
IP string `json:"ip"`
|
||||
Uptime FlexInt `json:"uptime"`
|
||||
Model string `json:"model"`
|
||||
Version string `json:"version"`
|
||||
Name string `json:"hostname"`
|
||||
Default FlexBool `json:"default"`
|
||||
Locating FlexBool `json:"locating"`
|
||||
Type string `json:"type"`
|
||||
Unsupported FlexBool `json:"unsupported"`
|
||||
UnsupportedReason FlexInt `json:"unsupported_reason"`
|
||||
DiscoveredVia string `json:"discovered_via"`
|
||||
AdoptIP string `json:"adopt_ip"`
|
||||
AdoptURL string `json:"adopt_url"`
|
||||
State FlexInt `json:"state"`
|
||||
AdoptStatus FlexInt `json:"adopt_status"`
|
||||
UpgradeState FlexInt `json:"upgrade_state"`
|
||||
LastSeen FlexInt `json:"last_seen"`
|
||||
AdoptableWhenUpgraded FlexBool `json:"adoptable_when_upgraded"`
|
||||
Cfgversion string `json:"cfgversion"`
|
||||
ConfigNetwork struct {
|
||||
Type string `json:"type"`
|
||||
IP string `json:"ip"`
|
||||
} `json:"config_network"`
|
||||
VwireTable []interface{} `json:"vwire_table"`
|
||||
Dot1XPortctrlEnabled FlexBool `json:"dot1x_portctrl_enabled"`
|
||||
JumboframeEnabled FlexBool `json:"jumboframe_enabled"`
|
||||
FlowctrlEnabled FlexBool `json:"flowctrl_enabled"`
|
||||
StpVersion string `json:"stp_version"`
|
||||
StpPriority string `json:"stp_priority"`
|
||||
PowerSourceCtrlEnabled FlexBool `json:"power_source_ctrl_enabled"`
|
||||
LicenseState string `json:"license_state"`
|
||||
ID string `json:"_id"`
|
||||
DeviceID string `json:"device_id"`
|
||||
AdoptState FlexInt `json:"adopt_state"`
|
||||
AdoptTries FlexInt `json:"adopt_tries"`
|
||||
AdoptManual FlexBool `json:"adopt_manual"`
|
||||
InformURL string `json:"inform_url"`
|
||||
InformIP string `json:"inform_ip"`
|
||||
RequiredVersion string `json:"required_version"`
|
||||
BoardRev FlexInt `json:"board_rev"`
|
||||
EthernetTable []struct {
|
||||
Mac string `json:"mac"`
|
||||
NumPort FlexInt `json:"num_port"`
|
||||
Name string `json:"name"`
|
||||
} `json:"ethernet_table"`
|
||||
PortTable []Port `json:"port_table"`
|
||||
EthernetOverrides []struct {
|
||||
Ifname string `json:"ifname"`
|
||||
Networkgroup string `json:"networkgroup"`
|
||||
} `json:"ethernet_overrides"`
|
||||
UsgCaps FlexInt `json:"usg_caps"`
|
||||
HasSpeaker FlexBool `json:"has_speaker"`
|
||||
HasEth1 FlexBool `json:"has_eth1"`
|
||||
FwCaps FlexInt `json:"fw_caps"`
|
||||
HwCaps FlexInt `json:"hw_caps"`
|
||||
SwitchCaps struct {
|
||||
MaxMirrorSessions FlexInt `json:"max_mirror_sessions"`
|
||||
MaxAggregateSessions FlexInt `json:"max_aggregate_sessions"`
|
||||
} `json:"switch_caps"`
|
||||
HasFan FlexBool `json:"has_fan"`
|
||||
HasTemperature FlexBool `json:"has_temperature"`
|
||||
RulesetInterfaces struct {
|
||||
Br0 string `json:"br0"`
|
||||
Eth8 string `json:"eth8"`
|
||||
Eth9 string `json:"eth9"`
|
||||
} `json:"ruleset_interfaces"`
|
||||
KnownCfgversion string `json:"known_cfgversion"`
|
||||
SysStats SysStats `json:"sys_stats"`
|
||||
SystemStats SystemStats `json:"system-stats"`
|
||||
GuestToken string `json:"guest_token"`
|
||||
Overheating FlexBool `json:"overheating"`
|
||||
SpeedtestStatus SpeedtestStatus `json:"speedtest-status"`
|
||||
SpeedtestStatusSaved FlexBool `json:"speedtest-status-saved"`
|
||||
Wan1 Wan `json:"wan1"`
|
||||
Wan2 Wan `json:"wan2"`
|
||||
Uplink Uplink `json:"uplink"`
|
||||
ConnectRequestIP string `json:"connect_request_ip"`
|
||||
ConnectRequestPort string `json:"connect_request_port"`
|
||||
DownlinkTable []interface{} `json:"downlink_table"`
|
||||
NetworkTable []struct {
|
||||
ID string `json:"_id"`
|
||||
AttrNoDelete FlexBool `json:"attr_no_delete"`
|
||||
AttrHiddenID string `json:"attr_hidden_id"`
|
||||
Name string `json:"name"`
|
||||
SiteID string `json:"site_id"`
|
||||
VlanEnabled FlexBool `json:"vlan_enabled"`
|
||||
Purpose string `json:"purpose"`
|
||||
IPSubnet string `json:"ip_subnet"`
|
||||
Ipv6InterfaceType string `json:"ipv6_interface_type"`
|
||||
DomainName string `json:"domain_name"`
|
||||
IsNat FlexBool `json:"is_nat"`
|
||||
DhcpdEnabled FlexBool `json:"dhcpd_enabled"`
|
||||
DhcpdStart string `json:"dhcpd_start"`
|
||||
DhcpdStop string `json:"dhcpd_stop"`
|
||||
Dhcpdv6Enabled FlexBool `json:"dhcpdv6_enabled"`
|
||||
Ipv6RaEnabled FlexBool `json:"ipv6_ra_enabled"`
|
||||
LteLanEnabled FlexBool `json:"lte_lan_enabled"`
|
||||
Networkgroup string `json:"networkgroup"`
|
||||
DhcpdLeasetime FlexInt `json:"dhcpd_leasetime"`
|
||||
DhcpdDNSEnabled FlexBool `json:"dhcpd_dns_enabled"`
|
||||
DhcpdGatewayEnabled FlexBool `json:"dhcpd_gateway_enabled"`
|
||||
DhcpdTimeOffsetEnabled FlexBool `json:"dhcpd_time_offset_enabled"`
|
||||
Ipv6PdStart string `json:"ipv6_pd_start"`
|
||||
Ipv6PdStop string `json:"ipv6_pd_stop"`
|
||||
DhcpdDNS1 string `json:"dhcpd_dns_1"`
|
||||
DhcpdDNS2 string `json:"dhcpd_dns_2"`
|
||||
DhcpdDNS3 string `json:"dhcpd_dns_3"`
|
||||
DhcpdDNS4 string `json:"dhcpd_dns_4"`
|
||||
Enabled FlexBool `json:"enabled"`
|
||||
DhcpRelayEnabled FlexBool `json:"dhcp_relay_enabled"`
|
||||
Mac string `json:"mac"`
|
||||
IsGuest FlexBool `json:"is_guest"`
|
||||
IP string `json:"ip"`
|
||||
Up FlexBool `json:"up"`
|
||||
DpistatsTable struct {
|
||||
LastUpdated FlexInt `json:"last_updated"`
|
||||
ByCat []struct {
|
||||
Cat FlexInt `json:"cat"`
|
||||
Apps []FlexInt `json:"apps"`
|
||||
RxBytes FlexInt `json:"rx_bytes"`
|
||||
TxBytes FlexInt `json:"tx_bytes"`
|
||||
RxPackets FlexInt `json:"rx_packets"`
|
||||
TxPackets FlexInt `json:"tx_packets"`
|
||||
} `json:"by_cat"`
|
||||
ByApp []struct {
|
||||
App FlexInt `json:"app"`
|
||||
Cat FlexInt `json:"cat"`
|
||||
Clients []struct {
|
||||
Mac string `json:"mac"`
|
||||
RxBytes FlexInt `json:"rx_bytes"`
|
||||
TxBytes FlexInt `json:"tx_bytes"`
|
||||
RxPackets FlexInt `json:"rx_packets"`
|
||||
TxPackets FlexInt `json:"tx_packets"`
|
||||
} `json:"clients"`
|
||||
KnownClients FlexInt `json:"known_clients"`
|
||||
RxBytes FlexInt `json:"rx_bytes"`
|
||||
TxBytes FlexInt `json:"tx_bytes"`
|
||||
RxPackets FlexInt `json:"rx_packets"`
|
||||
TxPackets FlexInt `json:"tx_packets"`
|
||||
} `json:"by_app"`
|
||||
} `json:"dpistats_table,omitempty"`
|
||||
NumSta FlexInt `json:"num_sta"`
|
||||
RxBytes FlexInt `json:"rx_bytes"`
|
||||
RxPackets FlexInt `json:"rx_packets"`
|
||||
TxBytes FlexInt `json:"tx_bytes"`
|
||||
TxPackets FlexInt `json:"tx_packets"`
|
||||
} `json:"network_table"`
|
||||
PortOverrides []struct {
|
||||
PortIdx FlexInt `json:"port_idx"`
|
||||
PortconfID string `json:"portconf_id"`
|
||||
} `json:"port_overrides"`
|
||||
Stat UDMStat `json:"stat"`
|
||||
TxBytes FlexInt `json:"tx_bytes"`
|
||||
RxBytes FlexInt `json:"rx_bytes"`
|
||||
Bytes FlexInt `json:"bytes"`
|
||||
NumSta FlexInt `json:"num_sta"`
|
||||
WlanNumSta FlexInt `json:"wlan-num_sta"`
|
||||
LanNumSta FlexInt `json:"lan-num_sta"`
|
||||
UserWlanNumSta FlexInt `json:"user-wlan-num_sta"`
|
||||
UserLanNumSta FlexInt `json:"user-lan-num_sta"`
|
||||
UserNumSta FlexInt `json:"user-num_sta"`
|
||||
GuestWlanNumSta FlexInt `json:"guest-wlan-num_sta"`
|
||||
GuestLanNumSta FlexInt `json:"guest-lan-num_sta"`
|
||||
GuestNumSta FlexInt `json:"guest-num_sta"`
|
||||
NumDesktop FlexInt `json:"num_desktop"`
|
||||
NumMobile FlexInt `json:"num_mobile"`
|
||||
NumHandheld FlexInt `json:"num_handheld"`
|
||||
}
|
||||
|
||||
// UDMStat holds the "stat" data for a dream machine.
|
||||
// A dream machine is a USG + USW + Controller
|
||||
type UDMStat struct {
|
||||
*gw
|
||||
*sw
|
||||
}
|
||||
|
|
@ -81,7 +81,6 @@ func (u *USG) PointsAt(now time.Time) ([]*influx.Point, error) {
|
|||
"wan1_bytes-r": u.Wan1.BytesR.Val,
|
||||
"wan1_enable": u.Wan1.Enable.Val,
|
||||
"wan1_full_duplex": u.Wan1.FullDuplex.Val,
|
||||
"wan1_purpose": "uplink", // because it should have a purpose.
|
||||
"wan1_gateway": u.Wan1.Gateway,
|
||||
"wan1_ifname": u.Wan1.Ifname,
|
||||
"wan1_ip": u.Wan1.IP,
|
||||
|
|
@ -106,7 +105,6 @@ func (u *USG) PointsAt(now time.Time) ([]*influx.Point, error) {
|
|||
"wan2_bytes-r": u.Wan2.BytesR.Val,
|
||||
"wan2_enable": u.Wan2.Enable.Val,
|
||||
"wan2_full_duplex": u.Wan2.FullDuplex.Val,
|
||||
"wan2_purpose": "uplink", // because it should have a purpose.
|
||||
"wan2_gateway": u.Wan2.Gateway,
|
||||
"wan2_ifname": u.Wan2.Ifname,
|
||||
"wan2_ip": u.Wan2.IP,
|
||||
|
|
@ -140,7 +138,6 @@ func (u *USG) PointsAt(now time.Time) ([]*influx.Point, error) {
|
|||
"stat_duration": u.Stat.Duration.Val,
|
||||
"stat_datetime": u.Stat.Datetime,
|
||||
"gw": u.Stat.Gw,
|
||||
"false": "false", // to fill holes in graphs.
|
||||
"lan-rx_bytes": u.Stat.LanRxBytes.Val,
|
||||
"lan-rx_packets": u.Stat.LanRxPackets.Val,
|
||||
"lan-tx_bytes": u.Stat.LanTxBytes.Val,
|
||||
|
|
@ -167,46 +164,36 @@ func (u *USG) PointsAt(now time.Time) ([]*influx.Point, error) {
|
|||
"device_id": u.ID,
|
||||
"device_mac": u.Mac,
|
||||
"site_name": u.SiteName,
|
||||
"name": p.Name,
|
||||
"up": p.Up.Txt,
|
||||
"dhcpd_dns_enabled": p.DhcpdDNSEnabled.Txt,
|
||||
"dhcpd_enabled": p.DhcpdEnabled.Txt,
|
||||
"dhcpd_ntp_enabled": p.DhcpdNtpEnabled.Txt,
|
||||
"dhcpd_time_offset_enabled": p.DhcpdTimeOffsetEnabled.Txt,
|
||||
"dhcp_relay_enabledy": p.DhcpRelayEnabled.Txt,
|
||||
"dhcpd_gateway_enabled": p.DhcpdGatewayEnabled.Txt,
|
||||
"dhcpd_wins_enabled": p.DhcpdWinsEnabled.Txt,
|
||||
"dhcpguard_enabled": p.DhcpguardEnabled.Txt,
|
||||
"enabled": p.Enabled.Txt,
|
||||
"vlan_enabled": p.VlanEnabled.Txt,
|
||||
"attr_no_delete": p.AttrNoDelete.Txt,
|
||||
"upnp_lan_enabled": p.UpnpLanEnabled.Txt,
|
||||
"igmp_snooping": p.IgmpSnooping.Txt,
|
||||
"is_guest": p.IsGuest.Txt,
|
||||
"is_nat": p.IsNat.Txt,
|
||||
"networkgroup": p.Networkgroup,
|
||||
"site_id": p.SiteID,
|
||||
}
|
||||
fields := map[string]interface{}{
|
||||
"dhcpd_ip_1": p.DhcpdIP1,
|
||||
"domain_name": p.DomainName,
|
||||
"dhcpd_start": p.DhcpdStart,
|
||||
"dhcpd_stop": p.DhcpdStop,
|
||||
"ip": p.IP,
|
||||
"ip_subnet": p.IPSubnet,
|
||||
"mac": p.Mac,
|
||||
"name": p.Name,
|
||||
"num_sta": p.NumSta.Val,
|
||||
"purpose": p.Purpose,
|
||||
"rx_bytes": p.RxBytes.Val,
|
||||
"rx_packets": p.RxPackets.Val,
|
||||
"tx_bytes": p.TxBytes.Val,
|
||||
"tx_packets": p.TxPackets.Val,
|
||||
"vlan": p.Vlan.Txt,
|
||||
"dhcpd_ntp_1": p.DhcpdNtp1,
|
||||
"dhcpd_unifi_controller": p.DhcpdUnifiController,
|
||||
"ipv6_interface_type": p.Ipv6InterfaceType,
|
||||
"attr_hidden_id": p.AttrHiddenID,
|
||||
"domain_name": p.DomainName,
|
||||
"dhcpd_start": p.DhcpdStart,
|
||||
"dhcpd_stop": p.DhcpdStop,
|
||||
"ip": p.IP,
|
||||
"ip_subnet": p.IPSubnet,
|
||||
"mac": p.Mac,
|
||||
"name": p.Name,
|
||||
"num_sta": p.NumSta.Val,
|
||||
"purpose": p.Purpose,
|
||||
"rx_bytes": p.RxBytes.Val,
|
||||
"rx_packets": p.RxPackets.Val,
|
||||
"tx_bytes": p.TxBytes.Val,
|
||||
"tx_packets": p.TxPackets.Val,
|
||||
"ipv6_interface_type": p.Ipv6InterfaceType,
|
||||
"attr_hidden_id": p.AttrHiddenID,
|
||||
}
|
||||
pt, err = influx.NewPoint("usg_networks", tags, fields, now)
|
||||
if err != nil {
|
||||
|
|
@ -223,13 +210,11 @@ func (u *USG) PointsAt(now time.Time) ([]*influx.Point, error) {
|
|||
"name": p.Name,
|
||||
"ifname": p.Ifname,
|
||||
"ip": p.IP,
|
||||
"netmask": p.Netmask,
|
||||
"mac": p.Mac,
|
||||
"up": p.Up.Txt,
|
||||
"speed": p.Speed.Txt,
|
||||
"full_duplex": p.FullDuplex.Txt,
|
||||
"enable": p.Enable.Txt,
|
||||
"gateway": p.Gateway,
|
||||
}
|
||||
fields := map[string]interface{}{
|
||||
"rx_bytes": p.RxBytes.Val,
|
||||
|
|
|
|||
|
|
@ -40,102 +40,29 @@ type USG struct {
|
|||
Ifname string `json:"ifname"`
|
||||
Networkgroup string `json:"networkgroup"`
|
||||
} `json:"ethernet_overrides"`
|
||||
HwCaps FlexInt `json:"hw_caps"`
|
||||
BoardRev FlexInt `json:"board_rev"`
|
||||
Unsupported FlexBool `json:"unsupported"`
|
||||
UnsupportedReason FlexInt `json:"unsupported_reason"`
|
||||
DeviceID string `json:"device_id"`
|
||||
State FlexInt `json:"state"`
|
||||
LastSeen FlexInt `json:"last_seen"`
|
||||
Upgradable FlexBool `json:"upgradable"`
|
||||
AdoptableWhenUpgraded FlexBool `json:"adoptable_when_upgraded"`
|
||||
Rollupgrade FlexBool `json:"rollupgrade"`
|
||||
KnownCfgversion string `json:"known_cfgversion"`
|
||||
Uptime FlexInt `json:"uptime"`
|
||||
Locating FlexBool `json:"locating"`
|
||||
ConnectRequestIP string `json:"connect_request_ip"`
|
||||
ConnectRequestPort string `json:"connect_request_port"`
|
||||
SysStats struct {
|
||||
Loadavg1 FlexInt `json:"loadavg_1"`
|
||||
Loadavg15 FlexInt `json:"loadavg_15"`
|
||||
Loadavg5 FlexInt `json:"loadavg_5"`
|
||||
MemBuffer FlexInt `json:"mem_buffer"`
|
||||
MemTotal FlexInt `json:"mem_total"`
|
||||
MemUsed FlexInt `json:"mem_used"`
|
||||
} `json:"sys_stats"`
|
||||
SystemStats struct {
|
||||
CPU FlexInt `json:"cpu"`
|
||||
Mem FlexInt `json:"mem"`
|
||||
Uptime FlexInt `json:"uptime"`
|
||||
} `json:"system-stats"`
|
||||
GuestToken string `json:"guest_token"`
|
||||
SpeedtestStatus struct {
|
||||
Latency FlexInt `json:"latency"`
|
||||
Rundate FlexInt `json:"rundate"`
|
||||
Runtime FlexInt `json:"runtime"`
|
||||
StatusDownload FlexInt `json:"status_download"`
|
||||
StatusPing FlexInt `json:"status_ping"`
|
||||
StatusSummary FlexInt `json:"status_summary"`
|
||||
StatusUpload FlexInt `json:"status_upload"`
|
||||
XputDownload FlexInt `json:"xput_download"`
|
||||
XputUpload FlexInt `json:"xput_upload"`
|
||||
} `json:"speedtest-status"`
|
||||
SpeedtestStatusSaved FlexBool `json:"speedtest-status-saved"`
|
||||
Wan1 struct {
|
||||
TxBytesR FlexInt `json:"tx_bytes-r"`
|
||||
RxBytesR FlexInt `json:"rx_bytes-r"`
|
||||
BytesR FlexInt `json:"bytes-r"`
|
||||
MaxSpeed FlexInt `json:"max_speed"`
|
||||
Type string `json:"type"`
|
||||
Name string `json:"name"`
|
||||
Ifname string `json:"ifname"`
|
||||
IP string `json:"ip"`
|
||||
Netmask string `json:"netmask"`
|
||||
Mac string `json:"mac"`
|
||||
Up FlexBool `json:"up"`
|
||||
Speed FlexInt `json:"speed"`
|
||||
FullDuplex FlexBool `json:"full_duplex"`
|
||||
RxBytes FlexInt `json:"rx_bytes"`
|
||||
RxDropped FlexInt `json:"rx_dropped"`
|
||||
RxErrors FlexInt `json:"rx_errors"`
|
||||
RxPackets FlexInt `json:"rx_packets"`
|
||||
TxBytes FlexInt `json:"tx_bytes"`
|
||||
TxDropped FlexInt `json:"tx_dropped"`
|
||||
TxErrors FlexInt `json:"tx_errors"`
|
||||
TxPackets FlexInt `json:"tx_packets"`
|
||||
RxMulticast FlexInt `json:"rx_multicast"`
|
||||
Enable FlexBool `json:"enable"`
|
||||
DNS []string `json:"dns"`
|
||||
Gateway string `json:"gateway"`
|
||||
} `json:"wan1"`
|
||||
Wan2 struct {
|
||||
TxBytesR FlexInt `json:"tx_bytes-r"`
|
||||
RxBytesR FlexInt `json:"rx_bytes-r"`
|
||||
BytesR FlexInt `json:"bytes-r"`
|
||||
MaxSpeed FlexInt `json:"max_speed"`
|
||||
Type string `json:"type"`
|
||||
Name string `json:"name"`
|
||||
Ifname string `json:"ifname"`
|
||||
IP string `json:"ip"`
|
||||
Netmask string `json:"netmask"`
|
||||
Mac string `json:"mac"`
|
||||
Up FlexBool `json:"up"`
|
||||
Speed FlexInt `json:"speed"`
|
||||
FullDuplex FlexBool `json:"full_duplex"`
|
||||
RxBytes FlexInt `json:"rx_bytes"`
|
||||
RxDropped FlexInt `json:"rx_dropped"`
|
||||
RxErrors FlexInt `json:"rx_errors"`
|
||||
RxPackets FlexInt `json:"rx_packets"`
|
||||
TxBytes FlexInt `json:"tx_bytes"`
|
||||
TxDropped FlexInt `json:"tx_dropped"`
|
||||
TxErrors FlexInt `json:"tx_errors"`
|
||||
TxPackets FlexInt `json:"tx_packets"`
|
||||
RxMulticast FlexInt `json:"rx_multicast"`
|
||||
Enable FlexBool `json:"enable"`
|
||||
DNS []string `json:"dns"`
|
||||
Gateway string `json:"gateway"`
|
||||
} `json:"wan2"`
|
||||
PortTable []struct {
|
||||
HwCaps FlexInt `json:"hw_caps"`
|
||||
BoardRev FlexInt `json:"board_rev"`
|
||||
Unsupported FlexBool `json:"unsupported"`
|
||||
UnsupportedReason FlexInt `json:"unsupported_reason"`
|
||||
DeviceID string `json:"device_id"`
|
||||
State FlexInt `json:"state"`
|
||||
LastSeen FlexInt `json:"last_seen"`
|
||||
Upgradable FlexBool `json:"upgradable"`
|
||||
AdoptableWhenUpgraded FlexBool `json:"adoptable_when_upgraded"`
|
||||
Rollupgrade FlexBool `json:"rollupgrade"`
|
||||
KnownCfgversion string `json:"known_cfgversion"`
|
||||
Uptime FlexInt `json:"uptime"`
|
||||
Locating FlexBool `json:"locating"`
|
||||
ConnectRequestIP string `json:"connect_request_ip"`
|
||||
ConnectRequestPort string `json:"connect_request_port"`
|
||||
SysStats SysStats `json:"sys_stats"`
|
||||
SystemStats SystemStats `json:"system-stats"`
|
||||
GuestToken string `json:"guest_token"`
|
||||
SpeedtestStatus SpeedtestStatus `json:"speedtest-status"`
|
||||
SpeedtestStatusSaved FlexBool `json:"speedtest-status-saved"`
|
||||
Wan1 Wan `json:"wan1"`
|
||||
Wan2 Wan `json:"wan2"`
|
||||
PortTable []struct {
|
||||
Name string `json:"name"`
|
||||
Ifname string `json:"ifname"`
|
||||
IP string `json:"ip"`
|
||||
|
|
@ -198,41 +125,7 @@ type USG struct {
|
|||
AttrNoDelete FlexBool `json:"attr_no_delete,omitempty"`
|
||||
AttrHiddenID string `json:"attr_hidden_id,omitempty"`
|
||||
} `json:"network_table"`
|
||||
Uplink struct {
|
||||
Drops FlexInt `json:"drops"`
|
||||
Enable FlexBool `json:"enable"`
|
||||
FullDuplex FlexBool `json:"full_duplex"`
|
||||
Gateways []string `json:"gateways"`
|
||||
IP string `json:"ip"`
|
||||
Latency FlexInt `json:"latency"`
|
||||
Mac string `json:"mac"`
|
||||
Name string `json:"name"`
|
||||
Nameservers []string `json:"nameservers"`
|
||||
Netmask string `json:"netmask"`
|
||||
NumPort FlexInt `json:"num_port"`
|
||||
RxBytes FlexInt `json:"rx_bytes"`
|
||||
RxDropped FlexInt `json:"rx_dropped"`
|
||||
RxErrors FlexInt `json:"rx_errors"`
|
||||
RxMulticast FlexInt `json:"rx_multicast"`
|
||||
RxPackets FlexInt `json:"rx_packets"`
|
||||
Speed FlexInt `json:"speed"`
|
||||
SpeedtestLastrun FlexInt `json:"speedtest_lastrun"`
|
||||
SpeedtestPing FlexInt `json:"speedtest_ping"`
|
||||
SpeedtestStatus string `json:"speedtest_status"`
|
||||
TxBytes FlexInt `json:"tx_bytes"`
|
||||
TxDropped FlexInt `json:"tx_dropped"`
|
||||
TxErrors FlexInt `json:"tx_errors"`
|
||||
TxPackets FlexInt `json:"tx_packets"`
|
||||
Up FlexBool `json:"up"`
|
||||
Uptime FlexInt `json:"uptime"`
|
||||
XputDown FlexInt `json:"xput_down"`
|
||||
XputUp FlexInt `json:"xput_up"`
|
||||
TxBytesR FlexInt `json:"tx_bytes-r"`
|
||||
RxBytesR FlexInt `json:"rx_bytes-r"`
|
||||
BytesR FlexInt `json:"bytes-r"`
|
||||
MaxSpeed FlexInt `json:"max_speed"`
|
||||
Type string `json:"type"`
|
||||
} `json:"uplink"`
|
||||
Uplink Uplink `json:"uplink"`
|
||||
Stat USGStat `json:"stat"`
|
||||
TxBytes FlexInt `json:"tx_bytes"`
|
||||
RxBytes FlexInt `json:"rx_bytes"`
|
||||
|
|
@ -245,6 +138,114 @@ type USG struct {
|
|||
NumHandheld FlexInt `json:"num_handheld"`
|
||||
}
|
||||
|
||||
// Uplink is the Internet connection (or uplink) on a UniFi device.
|
||||
type Uplink struct {
|
||||
BytesR FlexInt `json:"bytes-r"`
|
||||
Drops FlexInt `json:"drops"`
|
||||
Enable FlexBool `json:"enable,omitempty"`
|
||||
FullDuplex FlexBool `json:"full_duplex"`
|
||||
Gateways []string `json:"gateways,omitempty"`
|
||||
IP string `json:"ip"`
|
||||
Latency FlexInt `json:"latency"`
|
||||
Mac string `json:"mac,omitempty"`
|
||||
MaxSpeed FlexInt `json:"max_speed"`
|
||||
Name string `json:"name"`
|
||||
Nameservers []string `json:"nameservers"`
|
||||
Netmask string `json:"netmask"`
|
||||
NumPort FlexInt `json:"num_port"`
|
||||
RxBytes FlexInt `json:"rx_bytes"`
|
||||
RxBytesR FlexInt `json:"rx_bytes-r"`
|
||||
RxDropped FlexInt `json:"rx_dropped"`
|
||||
RxErrors FlexInt `json:"rx_errors"`
|
||||
RxMulticast FlexInt `json:"rx_multicast"`
|
||||
RxPackets FlexInt `json:"rx_packets"`
|
||||
Speed FlexInt `json:"speed"`
|
||||
SpeedtestLastrun FlexInt `json:"speedtest_lastrun,omitempty"`
|
||||
SpeedtestPing FlexInt `json:"speedtest_ping,omitempty"`
|
||||
SpeedtestStatus string `json:"speedtest_status,omitempty"`
|
||||
TxBytes FlexInt `json:"tx_bytes"`
|
||||
TxBytesR FlexInt `json:"tx_bytes-r"`
|
||||
TxDropped FlexInt `json:"tx_dropped"`
|
||||
TxErrors FlexInt `json:"tx_errors"`
|
||||
TxPackets FlexInt `json:"tx_packets"`
|
||||
Type string `json:"type"`
|
||||
Up FlexBool `json:"up"`
|
||||
Uptime FlexInt `json:"uptime"`
|
||||
XputDown FlexInt `json:"xput_down,omitempty"`
|
||||
XputUp FlexInt `json:"xput_up,omitempty"`
|
||||
}
|
||||
|
||||
// Wan is a Wan interface on a USG or UDM.
|
||||
type Wan struct {
|
||||
Autoneg FlexBool `json:"autoneg"`
|
||||
BytesR FlexInt `json:"bytes-r"`
|
||||
DNS []string `json:"dns"`
|
||||
Enable FlexBool `json:"enable"`
|
||||
FlowctrlRx FlexBool `json:"flowctrl_rx"`
|
||||
FlowctrlTx FlexBool `json:"flowctrl_tx"`
|
||||
FullDuplex FlexBool `json:"full_duplex"`
|
||||
Gateway string `json:"gateway"` // may be deprecated
|
||||
IP string `json:"ip"`
|
||||
Ifname string `json:"ifname"`
|
||||
IsUplink FlexBool `json:"is_uplink"`
|
||||
Mac string `json:"mac"`
|
||||
MaxSpeed FlexInt `json:"max_speed"`
|
||||
Media string `json:"media"`
|
||||
Name string `json:"name"`
|
||||
Netmask string `json:"netmask"` // may be deprecated
|
||||
NumPort int `json:"num_port"`
|
||||
PortIdx int `json:"port_idx"`
|
||||
PortPoe FlexBool `json:"port_poe"`
|
||||
RxBroadcast FlexInt `json:"rx_broadcast"`
|
||||
RxBytes FlexInt `json:"rx_bytes"`
|
||||
RxBytesR FlexInt `json:"rx_bytes-r"`
|
||||
RxDropped FlexInt `json:"rx_dropped"`
|
||||
RxErrors FlexInt `json:"rx_errors"`
|
||||
RxMulticast FlexInt `json:"rx_multicast"`
|
||||
RxPackets FlexInt `json:"rx_packets"`
|
||||
Speed FlexInt `json:"speed"`
|
||||
TxBroadcast FlexInt `json:"tx_broadcast"`
|
||||
TxBytes FlexInt `json:"tx_bytes"`
|
||||
TxBytesR FlexInt `json:"tx_bytes-r"`
|
||||
TxDropped FlexInt `json:"tx_dropped"`
|
||||
TxErrors FlexInt `json:"tx_errors"`
|
||||
TxMulticast FlexInt `json:"tx_multicast"`
|
||||
TxPackets FlexInt `json:"tx_packets"`
|
||||
Type string `json:"type"`
|
||||
Up FlexBool `json:"up"`
|
||||
}
|
||||
|
||||
// SpeedtestStatus is the speed test info on a USG or UDM.
|
||||
type SpeedtestStatus struct {
|
||||
Latency FlexInt `json:"latency"`
|
||||
Rundate FlexInt `json:"rundate"`
|
||||
Runtime FlexInt `json:"runtime"`
|
||||
ServerDesc string `json:"server_desc,omitempty"`
|
||||
StatusDownload FlexInt `json:"status_download"`
|
||||
StatusPing FlexInt `json:"status_ping"`
|
||||
StatusSummary FlexInt `json:"status_summary"`
|
||||
StatusUpload FlexInt `json:"status_upload"`
|
||||
XputDownload FlexInt `json:"xput_download"`
|
||||
XputUpload FlexInt `json:"xput_upload"`
|
||||
}
|
||||
|
||||
// SystemStats is system info for a UDM, USG, USW.
|
||||
type SystemStats struct {
|
||||
CPU FlexInt `json:"cpu"`
|
||||
Mem FlexInt `json:"mem"`
|
||||
Uptime FlexInt `json:"uptime"`
|
||||
}
|
||||
|
||||
// SysStats is load info for a UDM, USG, USW.
|
||||
type SysStats struct {
|
||||
Loadavg1 FlexInt `json:"loadavg_1"`
|
||||
Loadavg15 FlexInt `json:"loadavg_15"`
|
||||
Loadavg5 FlexInt `json:"loadavg_5"`
|
||||
MemBuffer FlexInt `json:"mem_buffer"`
|
||||
MemTotal FlexInt `json:"mem_total"`
|
||||
MemUsed FlexInt `json:"mem_used"`
|
||||
}
|
||||
|
||||
// USGStat holds the "stat" data for a gateway.
|
||||
// This is split out because of a JSON data format change from 5.10 to 5.11.
|
||||
type USGStat struct {
|
||||
|
|
@ -261,14 +262,15 @@ type gw struct {
|
|||
Duration FlexInt `json:"duration"`
|
||||
WanRxPackets FlexInt `json:"wan-rx_packets"`
|
||||
WanRxBytes FlexInt `json:"wan-rx_bytes"`
|
||||
WanRxDropped FlexInt `json:"wan-rx_dropped"`
|
||||
WanTxPackets FlexInt `json:"wan-tx_packets"`
|
||||
WanTxBytes FlexInt `json:"wan-tx_bytes"`
|
||||
LanRxPackets FlexInt `json:"lan-rx_packets"`
|
||||
LanRxBytes FlexInt `json:"lan-rx_bytes"`
|
||||
LanTxPackets FlexInt `json:"lan-tx_packets"`
|
||||
LanTxBytes FlexInt `json:"lan-tx_bytes"`
|
||||
WanRxDropped FlexInt `json:"wan-rx_dropped"`
|
||||
LanRxDropped FlexInt `json:"lan-rx_dropped"`
|
||||
WanRxErrors FlexInt `json:"wan-rx_errors,omitempty"`
|
||||
}
|
||||
|
||||
// UnmarshalJSON unmarshalls 5.10 or 5.11 formatted Gateway Stat data.
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ func (u *USW) PointsAt(now time.Time) ([]*influx.Point, error) {
|
|||
tags := map[string]string{
|
||||
"id": u.ID,
|
||||
"mac": u.Mac,
|
||||
"device_type": u.Stat.O,
|
||||
"device_oid": u.Stat.Oid,
|
||||
"site_id": u.SiteID,
|
||||
"site_name": u.SiteName,
|
||||
|
|
@ -34,12 +33,9 @@ func (u *USW) PointsAt(now time.Time) ([]*influx.Point, error) {
|
|||
"config_network_type": u.ConfigNetwork.Type,
|
||||
"device_id": u.DeviceID,
|
||||
"inform_ip": u.InformIP,
|
||||
"last_uplink_mac": u.LastUplink.UplinkMac,
|
||||
"known_cfgversion": u.KnownCfgversion,
|
||||
"led_override": u.LedOverride,
|
||||
"locating": u.Locating.Txt,
|
||||
"model": u.Model,
|
||||
"outdoor_mode_override": u.OutdoorModeOverride,
|
||||
"serial": u.Serial,
|
||||
"type": u.Type,
|
||||
"dot1x_portctrl_enabled": u.Dot1XPortctrlEnabled.Txt,
|
||||
|
|
@ -51,57 +47,43 @@ func (u *USW) PointsAt(now time.Time) ([]*influx.Point, error) {
|
|||
"stp_version": u.StpVersion,
|
||||
}
|
||||
fields := map[string]interface{}{
|
||||
"fw_caps": u.FwCaps.Val,
|
||||
"guest-num_sta": u.GuestNumSta.Val,
|
||||
"ip": u.IP,
|
||||
"bytes": u.Bytes.Val,
|
||||
"fan_level": u.FanLevel.Val,
|
||||
"general_temperature": u.GeneralTemperature.Val,
|
||||
"last_seen": u.LastSeen.Val,
|
||||
"license_state": u.LicenseState,
|
||||
"overheating": u.Overheating.Val,
|
||||
"rx_bytes": u.RxBytes.Val,
|
||||
"tx_bytes": u.TxBytes.Val,
|
||||
"uptime": u.Uptime.Val,
|
||||
"roll_upgrade": u.Rollupgrade.Val,
|
||||
"state": u.State.Val,
|
||||
"upgradable": u.Upgradable.Val,
|
||||
"user-num_sta": u.UserNumSta.Val,
|
||||
"version": u.Version,
|
||||
"loadavg_1": u.SysStats.Loadavg1.Val,
|
||||
"loadavg_5": u.SysStats.Loadavg5.Val,
|
||||
"loadavg_15": u.SysStats.Loadavg15.Val,
|
||||
"mem_buffer": u.SysStats.MemBuffer.Val,
|
||||
"mem_used": u.SysStats.MemUsed.Val,
|
||||
"mem_total": u.SysStats.MemTotal.Val,
|
||||
"cpu": u.SystemStats.CPU.Val,
|
||||
"mem": u.SystemStats.Mem.Val,
|
||||
"system_uptime": u.SystemStats.Uptime.Val,
|
||||
"stat_bytes": u.Stat.Bytes.Val,
|
||||
"stat_duration": u.Stat.Duration.Val,
|
||||
"stat_guest-rx_bytes": u.Stat.RxBytes.Val,
|
||||
"stat_guest-rx_crypts": u.Stat.RxCrypts.Val,
|
||||
"stat_guest-rx_dropped": u.Stat.RxDropped.Val,
|
||||
"stat_guest-rx_errors": u.Stat.RxErrors.Val,
|
||||
"stat_guest-rx_frags": u.Stat.RxFrags.Val,
|
||||
"stat_guest-rx_packets": u.Stat.RxPackets.Val,
|
||||
"stat_guest-tx_bytes": u.Stat.TxBytes.Val,
|
||||
"stat_guest-tx_dropped": u.Stat.TxDropped.Val,
|
||||
"stat_guest-tx_errors": u.Stat.TxErrors.Val,
|
||||
"stat_guest-tx_packets": u.Stat.TxPackets.Val,
|
||||
"stat_guest-tx_retries": u.Stat.TxRetries.Val,
|
||||
"stat_rx_bytes": u.Stat.RxBytes.Val,
|
||||
"stat_rx_crypts": u.Stat.RxCrypts.Val,
|
||||
"stat_rx_dropped": u.Stat.RxDropped.Val,
|
||||
"stat_rx_errors": u.Stat.RxErrors.Val,
|
||||
"stat_rx_frags": u.Stat.RxFrags.Val,
|
||||
"stat_rx_packets": u.Stat.TxPackets.Val,
|
||||
"stat_tx_bytes": u.Stat.TxBytes.Val,
|
||||
"stat_tx_dropped": u.Stat.TxDropped.Val,
|
||||
"stat_tx_errors": u.Stat.TxErrors.Val,
|
||||
"stat_tx_packets": u.Stat.TxPackets.Val,
|
||||
"stat_tx_retries": u.Stat.TxRetries.Val,
|
||||
"uplink_depth": u.UplinkDepth.Txt,
|
||||
"fw_caps": u.FwCaps.Val,
|
||||
"guest-num_sta": u.GuestNumSta.Val,
|
||||
"ip": u.IP,
|
||||
"bytes": u.Bytes.Val,
|
||||
"fan_level": u.FanLevel.Val,
|
||||
"general_temperature": u.GeneralTemperature.Val,
|
||||
"last_seen": u.LastSeen.Val,
|
||||
"license_state": u.LicenseState,
|
||||
"overheating": u.Overheating.Val,
|
||||
"rx_bytes": u.RxBytes.Val,
|
||||
"tx_bytes": u.TxBytes.Val,
|
||||
"uptime": u.Uptime.Val,
|
||||
"state": u.State.Val,
|
||||
"user-num_sta": u.UserNumSta.Val,
|
||||
"version": u.Version,
|
||||
"loadavg_1": u.SysStats.Loadavg1.Val,
|
||||
"loadavg_5": u.SysStats.Loadavg5.Val,
|
||||
"loadavg_15": u.SysStats.Loadavg15.Val,
|
||||
"mem_buffer": u.SysStats.MemBuffer.Val,
|
||||
"mem_used": u.SysStats.MemUsed.Val,
|
||||
"mem_total": u.SysStats.MemTotal.Val,
|
||||
"cpu": u.SystemStats.CPU.Val,
|
||||
"mem": u.SystemStats.Mem.Val,
|
||||
"system_uptime": u.SystemStats.Uptime.Val,
|
||||
"stat_bytes": u.Stat.Bytes.Val,
|
||||
"stat_rx_bytes": u.Stat.RxBytes.Val,
|
||||
"stat_rx_crypts": u.Stat.RxCrypts.Val,
|
||||
"stat_rx_dropped": u.Stat.RxDropped.Val,
|
||||
"stat_rx_errors": u.Stat.RxErrors.Val,
|
||||
"stat_rx_frags": u.Stat.RxFrags.Val,
|
||||
"stat_rx_packets": u.Stat.TxPackets.Val,
|
||||
"stat_tx_bytes": u.Stat.TxBytes.Val,
|
||||
"stat_tx_dropped": u.Stat.TxDropped.Val,
|
||||
"stat_tx_errors": u.Stat.TxErrors.Val,
|
||||
"stat_tx_packets": u.Stat.TxPackets.Val,
|
||||
"stat_tx_retries": u.Stat.TxRetries.Val,
|
||||
"uplink_depth": u.UplinkDepth.Txt,
|
||||
// Add the port stats too.
|
||||
}
|
||||
pt, err := influx.NewPoint("usw", tags, fields, now)
|
||||
|
|
|
|||
|
|
@ -42,55 +42,7 @@ type USW struct {
|
|||
PortIdx FlexInt `json:"port_idx"`
|
||||
PortconfID string `json:"portconf_id"`
|
||||
} `json:"port_overrides"`
|
||||
PortTable []struct {
|
||||
PortIdx FlexInt `json:"port_idx"`
|
||||
Media string `json:"media"`
|
||||
PortPoe FlexBool `json:"port_poe"`
|
||||
PoeCaps FlexInt `json:"poe_caps"`
|
||||
SpeedCaps FlexInt `json:"speed_caps"`
|
||||
OpMode string `json:"op_mode"`
|
||||
PortconfID string `json:"portconf_id"`
|
||||
PoeMode string `json:"poe_mode,omitempty"`
|
||||
Autoneg FlexBool `json:"autoneg"`
|
||||
Dot1XMode string `json:"dot1x_mode"`
|
||||
Dot1XStatus string `json:"dot1x_status"`
|
||||
Enable FlexBool `json:"enable"`
|
||||
FlowctrlRx FlexBool `json:"flowctrl_rx"`
|
||||
FlowctrlTx FlexBool `json:"flowctrl_tx"`
|
||||
FullDuplex FlexBool `json:"full_duplex"`
|
||||
IsUplink FlexBool `json:"is_uplink"`
|
||||
Jumbo FlexBool `json:"jumbo"`
|
||||
PoeClass string `json:"poe_class,omitempty"`
|
||||
PoeCurrent FlexInt `json:"poe_current,omitempty"`
|
||||
PoeEnable FlexBool `json:"poe_enable,omitempty"`
|
||||
PoeGood FlexBool `json:"poe_good,omitempty"`
|
||||
PoePower FlexInt `json:"poe_power,omitempty"`
|
||||
PoeVoltage FlexInt `json:"poe_voltage,omitempty"`
|
||||
RxBroadcast FlexInt `json:"rx_broadcast"`
|
||||
RxBytes FlexInt `json:"rx_bytes"`
|
||||
RxDropped FlexInt `json:"rx_dropped"`
|
||||
RxErrors FlexInt `json:"rx_errors"`
|
||||
RxMulticast FlexInt `json:"rx_multicast"`
|
||||
RxPackets FlexInt `json:"rx_packets"`
|
||||
Satisfaction FlexInt `json:"satisfaction"`
|
||||
Speed FlexInt `json:"speed"`
|
||||
StpPathcost FlexInt `json:"stp_pathcost"`
|
||||
StpState string `json:"stp_state"`
|
||||
TxBroadcast FlexInt `json:"tx_broadcast"`
|
||||
TxBytes FlexInt `json:"tx_bytes"`
|
||||
TxDropped FlexInt `json:"tx_dropped"`
|
||||
TxErrors FlexInt `json:"tx_errors"`
|
||||
TxMulticast FlexInt `json:"tx_multicast"`
|
||||
TxPackets FlexInt `json:"tx_packets"`
|
||||
Up FlexBool `json:"up"`
|
||||
TxBytesR FlexInt `json:"tx_bytes-r"`
|
||||
RxBytesR FlexInt `json:"rx_bytes-r"`
|
||||
BytesR FlexInt `json:"bytes-r"`
|
||||
Name string `json:"name"`
|
||||
Masked FlexBool `json:"masked"`
|
||||
AggregatedBy FlexBool `json:"aggregated_by"`
|
||||
SfpFound FlexBool `json:"sfp_found,omitempty"`
|
||||
} `json:"port_table"`
|
||||
PortTable []Port `json:"port_table"`
|
||||
Serial string `json:"serial"`
|
||||
SiteID string `json:"site_id"`
|
||||
StpPriority string `json:"stp_priority"`
|
||||
|
|
@ -103,70 +55,34 @@ type USW struct {
|
|||
MaxMirrorSessions FlexInt `json:"max_mirror_sessions"`
|
||||
MaxAggregateSessions FlexInt `json:"max_aggregate_sessions"`
|
||||
} `json:"switch_caps"`
|
||||
HwCaps FlexInt `json:"hw_caps"`
|
||||
Unsupported FlexBool `json:"unsupported"`
|
||||
UnsupportedReason FlexInt `json:"unsupported_reason"`
|
||||
SysErrorCaps FlexInt `json:"sys_error_caps"`
|
||||
DeviceID string `json:"device_id"`
|
||||
State FlexInt `json:"state"`
|
||||
LastSeen FlexInt `json:"last_seen"`
|
||||
Upgradable FlexBool `json:"upgradable"`
|
||||
AdoptableWhenUpgraded FlexBool `json:"adoptable_when_upgraded"`
|
||||
Rollupgrade FlexBool `json:"rollupgrade"`
|
||||
KnownCfgversion string `json:"known_cfgversion"`
|
||||
Uptime FlexInt `json:"uptime"`
|
||||
Locating FlexBool `json:"locating"`
|
||||
ConnectRequestIP string `json:"connect_request_ip"`
|
||||
ConnectRequestPort string `json:"connect_request_port"`
|
||||
SysStats struct {
|
||||
Loadavg1 FlexInt `json:"loadavg_1"`
|
||||
Loadavg15 FlexInt `json:"loadavg_15"`
|
||||
Loadavg5 FlexInt `json:"loadavg_5"`
|
||||
MemBuffer FlexInt `json:"mem_buffer"`
|
||||
MemTotal FlexInt `json:"mem_total"`
|
||||
MemUsed FlexInt `json:"mem_used"`
|
||||
} `json:"sys_stats"`
|
||||
SystemStats struct {
|
||||
CPU FlexInt `json:"cpu"`
|
||||
Mem FlexInt `json:"mem"`
|
||||
Uptime FlexInt `json:"uptime"`
|
||||
} `json:"system-stats"`
|
||||
FanLevel FlexInt `json:"fan_level"`
|
||||
GeneralTemperature FlexInt `json:"general_temperature"`
|
||||
Overheating FlexBool `json:"overheating"`
|
||||
TotalMaxPower FlexInt `json:"total_max_power"`
|
||||
DownlinkTable []struct {
|
||||
HwCaps FlexInt `json:"hw_caps"`
|
||||
Unsupported FlexBool `json:"unsupported"`
|
||||
UnsupportedReason FlexInt `json:"unsupported_reason"`
|
||||
SysErrorCaps FlexInt `json:"sys_error_caps"`
|
||||
DeviceID string `json:"device_id"`
|
||||
State FlexInt `json:"state"`
|
||||
LastSeen FlexInt `json:"last_seen"`
|
||||
Upgradable FlexBool `json:"upgradable"`
|
||||
AdoptableWhenUpgraded FlexBool `json:"adoptable_when_upgraded"`
|
||||
Rollupgrade FlexBool `json:"rollupgrade"`
|
||||
KnownCfgversion string `json:"known_cfgversion"`
|
||||
Uptime FlexInt `json:"uptime"`
|
||||
Locating FlexBool `json:"locating"`
|
||||
ConnectRequestIP string `json:"connect_request_ip"`
|
||||
ConnectRequestPort string `json:"connect_request_port"`
|
||||
SysStats SysStats `json:"sys_stats"`
|
||||
SystemStats SystemStats `json:"system-stats"`
|
||||
FanLevel FlexInt `json:"fan_level"`
|
||||
GeneralTemperature FlexInt `json:"general_temperature"`
|
||||
Overheating FlexBool `json:"overheating"`
|
||||
TotalMaxPower FlexInt `json:"total_max_power"`
|
||||
DownlinkTable []struct {
|
||||
PortIdx FlexInt `json:"port_idx"`
|
||||
Speed FlexInt `json:"speed"`
|
||||
FullDuplex FlexBool `json:"full_duplex"`
|
||||
Mac string `json:"mac"`
|
||||
} `json:"downlink_table"`
|
||||
Uplink struct {
|
||||
FullDuplex FlexBool `json:"full_duplex"`
|
||||
IP string `json:"ip"`
|
||||
Mac string `json:"mac"`
|
||||
Name string `json:"name"`
|
||||
Netmask string `json:"netmask"`
|
||||
NumPort FlexInt `json:"num_port"`
|
||||
RxBytes FlexInt `json:"rx_bytes"`
|
||||
RxDropped FlexInt `json:"rx_dropped"`
|
||||
RxErrors FlexInt `json:"rx_errors"`
|
||||
RxMulticast FlexInt `json:"rx_multicast"`
|
||||
RxPackets FlexInt `json:"rx_packets"`
|
||||
Speed FlexInt `json:"speed"`
|
||||
TxBytes FlexInt `json:"tx_bytes"`
|
||||
TxDropped FlexInt `json:"tx_dropped"`
|
||||
TxErrors FlexInt `json:"tx_errors"`
|
||||
TxPackets FlexInt `json:"tx_packets"`
|
||||
Up FlexBool `json:"up"`
|
||||
PortIdx FlexInt `json:"port_idx"`
|
||||
Media string `json:"media"`
|
||||
MaxSpeed FlexInt `json:"max_speed"`
|
||||
UplinkMac string `json:"uplink_mac"`
|
||||
Type string `json:"type"`
|
||||
TxBytesR FlexInt `json:"tx_bytes-r"`
|
||||
RxBytesR FlexInt `json:"rx_bytes-r"`
|
||||
} `json:"uplink"`
|
||||
Uplink Uplink `json:"uplink"`
|
||||
LastUplink struct {
|
||||
UplinkMac string `json:"uplink_mac"`
|
||||
} `json:"last_uplink"`
|
||||
|
|
@ -180,6 +96,67 @@ type USW struct {
|
|||
GuestNumSta FlexInt `json:"guest-num_sta"`
|
||||
}
|
||||
|
||||
// Port is a physical connection on a USW or UDM.
|
||||
type Port struct {
|
||||
AggregatedBy FlexBool `json:"aggregated_by"`
|
||||
Autoneg FlexBool `json:"autoneg,omitempty"`
|
||||
BytesR FlexInt `json:"bytes-r"`
|
||||
DNS []string `json:"dns,omitempty"`
|
||||
Dot1XMode string `json:"dot1x_mode"`
|
||||
Dot1XStatus string `json:"dot1x_status"`
|
||||
Enable FlexBool `json:"enable"`
|
||||
FlowctrlRx FlexBool `json:"flowctrl_rx"`
|
||||
FlowctrlTx FlexBool `json:"flowctrl_tx"`
|
||||
FullDuplex FlexBool `json:"full_duplex"`
|
||||
IP string `json:"ip,omitempty"`
|
||||
Ifname string `json:"ifname,omitempty"`
|
||||
IsUplink FlexBool `json:"is_uplink"`
|
||||
Mac string `json:"mac,omitempty"`
|
||||
Jumbo FlexBool `json:"jumbo,omitempty"`
|
||||
Masked FlexBool `json:"masked"`
|
||||
Media string `json:"media"`
|
||||
Name string `json:"name"`
|
||||
NetworkName string `json:"network_name,omitempty"`
|
||||
NumPort int `json:"num_port,omitempty"`
|
||||
OpMode string `json:"op_mode"`
|
||||
PoeCaps FlexInt `json:"poe_caps"`
|
||||
PoeClass string `json:"poe_class,omitempty"`
|
||||
PoeCurrent FlexInt `json:"poe_current,omitempty"`
|
||||
PoeEnable FlexBool `json:"poe_enable,omitempty"`
|
||||
PoeGood FlexBool `json:"poe_good,omitempty"`
|
||||
PoeMode string `json:"poe_mode,omitempty"`
|
||||
PoePower FlexInt `json:"poe_power,omitempty"`
|
||||
PoeVoltage FlexInt `json:"poe_voltage,omitempty"`
|
||||
PortDelta struct {
|
||||
TimeDelta int64 `json:"time_delta"`
|
||||
} `json:"port_delta,omitempty"`
|
||||
PortIdx FlexInt `json:"port_idx"`
|
||||
PortPoe FlexBool `json:"port_poe"`
|
||||
PortconfID string `json:"portconf_id"`
|
||||
RxBroadcast FlexInt `json:"rx_broadcast"`
|
||||
RxBytes FlexInt `json:"rx_bytes"`
|
||||
RxBytesR FlexInt `json:"rx_bytes-r"`
|
||||
RxDropped FlexInt `json:"rx_dropped"`
|
||||
RxErrors FlexInt `json:"rx_errors"`
|
||||
RxMulticast FlexInt `json:"rx_multicast"`
|
||||
RxPackets FlexInt `json:"rx_packets"`
|
||||
Satisfaction FlexInt `json:"satisfaction,omitempty"`
|
||||
SfpFound FlexBool `json:"sfp_found,omitempty"`
|
||||
Speed FlexInt `json:"speed"`
|
||||
SpeedCaps FlexInt `json:"speed_caps"`
|
||||
StpPathcost FlexInt `json:"stp_pathcost"`
|
||||
StpState string `json:"stp_state"`
|
||||
TxBroadcast FlexInt `json:"tx_broadcast"`
|
||||
TxBytes FlexInt `json:"tx_bytes"`
|
||||
TxBytesR FlexInt `json:"tx_bytes-r"`
|
||||
TxDropped FlexInt `json:"tx_dropped"`
|
||||
TxErrors FlexInt `json:"tx_errors"`
|
||||
TxMulticast FlexInt `json:"tx_multicast"`
|
||||
TxPackets FlexInt `json:"tx_packets"`
|
||||
Type string `json:"type,omitempty"`
|
||||
Up FlexBool `json:"up"`
|
||||
}
|
||||
|
||||
// USWStat holds the "stat" data for a switch.
|
||||
// This is split out because of a JSON data format change from 5.10 to 5.11.
|
||||
type USWStat struct {
|
||||
|
|
@ -210,124 +187,124 @@ type sw struct {
|
|||
TxBroadcast FlexInt `json:"tx_broadcast"`
|
||||
Bytes FlexInt `json:"bytes"`
|
||||
Duration FlexInt `json:"duration"`
|
||||
Port1RxPackets FlexInt `json:"port_1-rx_packets"`
|
||||
Port1RxBytes FlexInt `json:"port_1-rx_bytes"`
|
||||
Port1TxPackets FlexInt `json:"port_1-tx_packets"`
|
||||
Port1TxBytes FlexInt `json:"port_1-tx_bytes"`
|
||||
Port1RxPackets FlexInt `json:"port_1-rx_packets,omitempty"`
|
||||
Port1RxBytes FlexInt `json:"port_1-rx_bytes,omitempty"`
|
||||
Port1TxPackets FlexInt `json:"port_1-tx_packets,omitempty"`
|
||||
Port1TxBytes FlexInt `json:"port_1-tx_bytes,omitempty"`
|
||||
Port1TxMulticast FlexInt `json:"port_1-tx_multicast"`
|
||||
Port1TxBroadcast FlexInt `json:"port_1-tx_broadcast"`
|
||||
Port3RxPackets FlexInt `json:"port_3-rx_packets"`
|
||||
Port3RxBytes FlexInt `json:"port_3-rx_bytes"`
|
||||
Port3TxPackets FlexInt `json:"port_3-tx_packets"`
|
||||
Port3TxBytes FlexInt `json:"port_3-tx_bytes"`
|
||||
Port3RxPackets FlexInt `json:"port_3-rx_packets,omitempty"`
|
||||
Port3RxBytes FlexInt `json:"port_3-rx_bytes,omitempty"`
|
||||
Port3TxPackets FlexInt `json:"port_3-tx_packets,omitempty"`
|
||||
Port3TxBytes FlexInt `json:"port_3-tx_bytes,omitempty"`
|
||||
Port3RxBroadcast FlexInt `json:"port_3-rx_broadcast"`
|
||||
Port3TxMulticast FlexInt `json:"port_3-tx_multicast"`
|
||||
Port3TxBroadcast FlexInt `json:"port_3-tx_broadcast"`
|
||||
Port6RxPackets FlexInt `json:"port_6-rx_packets"`
|
||||
Port6RxBytes FlexInt `json:"port_6-rx_bytes"`
|
||||
Port6TxPackets FlexInt `json:"port_6-tx_packets"`
|
||||
Port6TxBytes FlexInt `json:"port_6-tx_bytes"`
|
||||
Port6RxPackets FlexInt `json:"port_6-rx_packets,omitempty"`
|
||||
Port6RxBytes FlexInt `json:"port_6-rx_bytes,omitempty"`
|
||||
Port6TxPackets FlexInt `json:"port_6-tx_packets,omitempty"`
|
||||
Port6TxBytes FlexInt `json:"port_6-tx_bytes,omitempty"`
|
||||
Port6RxMulticast FlexInt `json:"port_6-rx_multicast"`
|
||||
Port6TxMulticast FlexInt `json:"port_6-tx_multicast"`
|
||||
Port6TxBroadcast FlexInt `json:"port_6-tx_broadcast"`
|
||||
Port7RxPackets FlexInt `json:"port_7-rx_packets"`
|
||||
Port7RxBytes FlexInt `json:"port_7-rx_bytes"`
|
||||
Port7TxPackets FlexInt `json:"port_7-tx_packets"`
|
||||
Port7TxBytes FlexInt `json:"port_7-tx_bytes"`
|
||||
Port7RxPackets FlexInt `json:"port_7-rx_packets,omitempty"`
|
||||
Port7RxBytes FlexInt `json:"port_7-rx_bytes,omitempty"`
|
||||
Port7TxPackets FlexInt `json:"port_7-tx_packets,omitempty"`
|
||||
Port7TxBytes FlexInt `json:"port_7-tx_bytes,omitempty"`
|
||||
Port7TxMulticast FlexInt `json:"port_7-tx_multicast"`
|
||||
Port7TxBroadcast FlexInt `json:"port_7-tx_broadcast"`
|
||||
Port9RxPackets FlexInt `json:"port_9-rx_packets"`
|
||||
Port9RxBytes FlexInt `json:"port_9-rx_bytes"`
|
||||
Port9TxPackets FlexInt `json:"port_9-tx_packets"`
|
||||
Port9TxBytes FlexInt `json:"port_9-tx_bytes"`
|
||||
Port9RxPackets FlexInt `json:"port_9-rx_packets,omitempty"`
|
||||
Port9RxBytes FlexInt `json:"port_9-rx_bytes,omitempty"`
|
||||
Port9TxPackets FlexInt `json:"port_9-tx_packets,omitempty"`
|
||||
Port9TxBytes FlexInt `json:"port_9-tx_bytes,omitempty"`
|
||||
Port9TxMulticast FlexInt `json:"port_9-tx_multicast"`
|
||||
Port9TxBroadcast FlexInt `json:"port_9-tx_broadcast"`
|
||||
Port10RxPackets FlexInt `json:"port_10-rx_packets"`
|
||||
Port10RxBytes FlexInt `json:"port_10-rx_bytes"`
|
||||
Port10TxPackets FlexInt `json:"port_10-tx_packets"`
|
||||
Port10TxBytes FlexInt `json:"port_10-tx_bytes"`
|
||||
Port10RxPackets FlexInt `json:"port_10-rx_packets,omitempty"`
|
||||
Port10RxBytes FlexInt `json:"port_10-rx_bytes,omitempty"`
|
||||
Port10TxPackets FlexInt `json:"port_10-tx_packets,omitempty"`
|
||||
Port10TxBytes FlexInt `json:"port_10-tx_bytes,omitempty"`
|
||||
Port10RxMulticast FlexInt `json:"port_10-rx_multicast"`
|
||||
Port10TxMulticast FlexInt `json:"port_10-tx_multicast"`
|
||||
Port10TxBroadcast FlexInt `json:"port_10-tx_broadcast"`
|
||||
Port11RxPackets FlexInt `json:"port_11-rx_packets"`
|
||||
Port11RxBytes FlexInt `json:"port_11-rx_bytes"`
|
||||
Port11TxPackets FlexInt `json:"port_11-tx_packets"`
|
||||
Port11TxBytes FlexInt `json:"port_11-tx_bytes"`
|
||||
Port11RxPackets FlexInt `json:"port_11-rx_packets,omitempty"`
|
||||
Port11RxBytes FlexInt `json:"port_11-rx_bytes,omitempty"`
|
||||
Port11TxPackets FlexInt `json:"port_11-tx_packets,omitempty"`
|
||||
Port11TxBytes FlexInt `json:"port_11-tx_bytes,omitempty"`
|
||||
Port11TxMulticast FlexInt `json:"port_11-tx_multicast"`
|
||||
Port11TxBroadcast FlexInt `json:"port_11-tx_broadcast"`
|
||||
Port12RxPackets FlexInt `json:"port_12-rx_packets"`
|
||||
Port12RxBytes FlexInt `json:"port_12-rx_bytes"`
|
||||
Port12TxPackets FlexInt `json:"port_12-tx_packets"`
|
||||
Port12TxBytes FlexInt `json:"port_12-tx_bytes"`
|
||||
Port12RxPackets FlexInt `json:"port_12-rx_packets,omitempty"`
|
||||
Port12RxBytes FlexInt `json:"port_12-rx_bytes,omitempty"`
|
||||
Port12TxPackets FlexInt `json:"port_12-tx_packets,omitempty"`
|
||||
Port12TxBytes FlexInt `json:"port_12-tx_bytes,omitempty"`
|
||||
Port12TxMulticast FlexInt `json:"port_12-tx_multicast"`
|
||||
Port12TxBroadcast FlexInt `json:"port_12-tx_broadcast"`
|
||||
Port13RxPackets FlexInt `json:"port_13-rx_packets"`
|
||||
Port13RxBytes FlexInt `json:"port_13-rx_bytes"`
|
||||
Port13TxPackets FlexInt `json:"port_13-tx_packets"`
|
||||
Port13TxBytes FlexInt `json:"port_13-tx_bytes"`
|
||||
Port13RxPackets FlexInt `json:"port_13-rx_packets,omitempty"`
|
||||
Port13RxBytes FlexInt `json:"port_13-rx_bytes,omitempty"`
|
||||
Port13TxPackets FlexInt `json:"port_13-tx_packets,omitempty"`
|
||||
Port13TxBytes FlexInt `json:"port_13-tx_bytes,omitempty"`
|
||||
Port13RxMulticast FlexInt `json:"port_13-rx_multicast"`
|
||||
Port13RxBroadcast FlexInt `json:"port_13-rx_broadcast"`
|
||||
Port13TxMulticast FlexInt `json:"port_13-tx_multicast"`
|
||||
Port13TxBroadcast FlexInt `json:"port_13-tx_broadcast"`
|
||||
Port15RxPackets FlexInt `json:"port_15-rx_packets"`
|
||||
Port15RxBytes FlexInt `json:"port_15-rx_bytes"`
|
||||
Port15TxPackets FlexInt `json:"port_15-tx_packets"`
|
||||
Port15TxBytes FlexInt `json:"port_15-tx_bytes"`
|
||||
Port15RxPackets FlexInt `json:"port_15-rx_packets,omitempty"`
|
||||
Port15RxBytes FlexInt `json:"port_15-rx_bytes,omitempty"`
|
||||
Port15TxPackets FlexInt `json:"port_15-tx_packets,omitempty"`
|
||||
Port15TxBytes FlexInt `json:"port_15-tx_bytes,omitempty"`
|
||||
Port15RxBroadcast FlexInt `json:"port_15-rx_broadcast"`
|
||||
Port15TxMulticast FlexInt `json:"port_15-tx_multicast"`
|
||||
Port15TxBroadcast FlexInt `json:"port_15-tx_broadcast"`
|
||||
Port16RxPackets FlexInt `json:"port_16-rx_packets"`
|
||||
Port16RxBytes FlexInt `json:"port_16-rx_bytes"`
|
||||
Port16TxPackets FlexInt `json:"port_16-tx_packets"`
|
||||
Port16TxBytes FlexInt `json:"port_16-tx_bytes"`
|
||||
Port16RxPackets FlexInt `json:"port_16-rx_packets,omitempty"`
|
||||
Port16RxBytes FlexInt `json:"port_16-rx_bytes,omitempty"`
|
||||
Port16TxPackets FlexInt `json:"port_16-tx_packets,omitempty"`
|
||||
Port16TxBytes FlexInt `json:"port_16-tx_bytes,omitempty"`
|
||||
Port16TxMulticast FlexInt `json:"port_16-tx_multicast"`
|
||||
Port16TxBroadcast FlexInt `json:"port_16-tx_broadcast"`
|
||||
Port17RxPackets FlexInt `json:"port_17-rx_packets"`
|
||||
Port17RxBytes FlexInt `json:"port_17-rx_bytes"`
|
||||
Port17TxPackets FlexInt `json:"port_17-tx_packets"`
|
||||
Port17TxBytes FlexInt `json:"port_17-tx_bytes"`
|
||||
Port17RxPackets FlexInt `json:"port_17-rx_packets,omitempty"`
|
||||
Port17RxBytes FlexInt `json:"port_17-rx_bytes,omitempty"`
|
||||
Port17TxPackets FlexInt `json:"port_17-tx_packets,omitempty"`
|
||||
Port17TxBytes FlexInt `json:"port_17-tx_bytes,omitempty"`
|
||||
Port17TxMulticast FlexInt `json:"port_17-tx_multicast"`
|
||||
Port17TxBroadcast FlexInt `json:"port_17-tx_broadcast"`
|
||||
Port18RxPackets FlexInt `json:"port_18-rx_packets"`
|
||||
Port18RxBytes FlexInt `json:"port_18-rx_bytes"`
|
||||
Port18TxPackets FlexInt `json:"port_18-tx_packets"`
|
||||
Port18TxBytes FlexInt `json:"port_18-tx_bytes"`
|
||||
Port18RxPackets FlexInt `json:"port_18-rx_packets,omitempty"`
|
||||
Port18RxBytes FlexInt `json:"port_18-rx_bytes,omitempty"`
|
||||
Port18TxPackets FlexInt `json:"port_18-tx_packets,omitempty"`
|
||||
Port18TxBytes FlexInt `json:"port_18-tx_bytes,omitempty"`
|
||||
Port18RxMulticast FlexInt `json:"port_18-rx_multicast"`
|
||||
Port18TxMulticast FlexInt `json:"port_18-tx_multicast"`
|
||||
Port18TxBroadcast FlexInt `json:"port_18-tx_broadcast"`
|
||||
Port19RxPackets FlexInt `json:"port_19-rx_packets"`
|
||||
Port19RxBytes FlexInt `json:"port_19-rx_bytes"`
|
||||
Port19TxPackets FlexInt `json:"port_19-tx_packets"`
|
||||
Port19TxBytes FlexInt `json:"port_19-tx_bytes"`
|
||||
Port19RxPackets FlexInt `json:"port_19-rx_packets,omitempty"`
|
||||
Port19RxBytes FlexInt `json:"port_19-rx_bytes,omitempty"`
|
||||
Port19TxPackets FlexInt `json:"port_19-tx_packets,omitempty"`
|
||||
Port19TxBytes FlexInt `json:"port_19-tx_bytes,omitempty"`
|
||||
Port19TxMulticast FlexInt `json:"port_19-tx_multicast"`
|
||||
Port19TxBroadcast FlexInt `json:"port_19-tx_broadcast"`
|
||||
Port21RxPackets FlexInt `json:"port_21-rx_packets"`
|
||||
Port21RxBytes FlexInt `json:"port_21-rx_bytes"`
|
||||
Port21TxPackets FlexInt `json:"port_21-tx_packets"`
|
||||
Port21TxBytes FlexInt `json:"port_21-tx_bytes"`
|
||||
Port21RxPackets FlexInt `json:"port_21-rx_packets,omitempty"`
|
||||
Port21RxBytes FlexInt `json:"port_21-rx_bytes,omitempty"`
|
||||
Port21TxPackets FlexInt `json:"port_21-tx_packets,omitempty"`
|
||||
Port21TxBytes FlexInt `json:"port_21-tx_bytes,omitempty"`
|
||||
Port21RxBroadcast FlexInt `json:"port_21-rx_broadcast"`
|
||||
Port21TxMulticast FlexInt `json:"port_21-tx_multicast"`
|
||||
Port21TxBroadcast FlexInt `json:"port_21-tx_broadcast"`
|
||||
Port22RxPackets FlexInt `json:"port_22-rx_packets"`
|
||||
Port22RxBytes FlexInt `json:"port_22-rx_bytes"`
|
||||
Port22TxPackets FlexInt `json:"port_22-tx_packets"`
|
||||
Port22TxBytes FlexInt `json:"port_22-tx_bytes"`
|
||||
Port22RxPackets FlexInt `json:"port_22-rx_packets,omitempty"`
|
||||
Port22RxBytes FlexInt `json:"port_22-rx_bytes,omitempty"`
|
||||
Port22TxPackets FlexInt `json:"port_22-tx_packets,omitempty"`
|
||||
Port22TxBytes FlexInt `json:"port_22-tx_bytes,omitempty"`
|
||||
Port22RxMulticast FlexInt `json:"port_22-rx_multicast"`
|
||||
Port22TxMulticast FlexInt `json:"port_22-tx_multicast"`
|
||||
Port22TxBroadcast FlexInt `json:"port_22-tx_broadcast"`
|
||||
Port23RxPackets FlexInt `json:"port_23-rx_packets"`
|
||||
Port23RxBytes FlexInt `json:"port_23-rx_bytes"`
|
||||
Port23RxPackets FlexInt `json:"port_23-rx_packets,omitempty"`
|
||||
Port23RxBytes FlexInt `json:"port_23-rx_bytes,omitempty"`
|
||||
Port23RxDropped FlexInt `json:"port_23-rx_dropped"`
|
||||
Port23TxPackets FlexInt `json:"port_23-tx_packets"`
|
||||
Port23TxBytes FlexInt `json:"port_23-tx_bytes"`
|
||||
Port23TxPackets FlexInt `json:"port_23-tx_packets,omitempty"`
|
||||
Port23TxBytes FlexInt `json:"port_23-tx_bytes,omitempty"`
|
||||
Port23RxMulticast FlexInt `json:"port_23-rx_multicast"`
|
||||
Port23RxBroadcast FlexInt `json:"port_23-rx_broadcast"`
|
||||
Port23TxMulticast FlexInt `json:"port_23-tx_multicast"`
|
||||
Port23TxBroadcast FlexInt `json:"port_23-tx_broadcast"`
|
||||
Port24RxPackets FlexInt `json:"port_24-rx_packets"`
|
||||
Port24RxBytes FlexInt `json:"port_24-rx_bytes"`
|
||||
Port24TxPackets FlexInt `json:"port_24-tx_packets"`
|
||||
Port24TxBytes FlexInt `json:"port_24-tx_bytes"`
|
||||
Port24RxPackets FlexInt `json:"port_24-rx_packets,omitempty"`
|
||||
Port24RxBytes FlexInt `json:"port_24-rx_bytes,omitempty"`
|
||||
Port24TxPackets FlexInt `json:"port_24-tx_packets,omitempty"`
|
||||
Port24TxBytes FlexInt `json:"port_24-tx_bytes,omitempty"`
|
||||
Port24RxMulticast FlexInt `json:"port_24-rx_multicast"`
|
||||
Port24TxMulticast FlexInt `json:"port_24-tx_multicast"`
|
||||
Port24TxBroadcast FlexInt `json:"port_24-tx_broadcast"`
|
||||
|
|
@ -366,11 +343,11 @@ type sw struct {
|
|||
Port10TxDropped FlexInt `json:"port_10-tx_dropped"`
|
||||
Port16TxDropped FlexInt `json:"port_16-tx_dropped"`
|
||||
Port1RxBroadcast FlexInt `json:"port_1-rx_broadcast"`
|
||||
Port4RxPackets FlexInt `json:"port_4-rx_packets"`
|
||||
Port4RxBytes FlexInt `json:"port_4-rx_bytes"`
|
||||
Port4RxPackets FlexInt `json:"port_4-rx_packets,omitempty"`
|
||||
Port4RxBytes FlexInt `json:"port_4-rx_bytes,omitempty"`
|
||||
Port4RxDropped FlexInt `json:"port_4-rx_dropped"`
|
||||
Port4TxPackets FlexInt `json:"port_4-tx_packets"`
|
||||
Port4TxBytes FlexInt `json:"port_4-tx_bytes"`
|
||||
Port4TxPackets FlexInt `json:"port_4-tx_packets,omitempty"`
|
||||
Port4TxBytes FlexInt `json:"port_4-tx_bytes,omitempty"`
|
||||
Port4TxDropped FlexInt `json:"port_4-tx_dropped"`
|
||||
Port4RxMulticast FlexInt `json:"port_4-rx_multicast"`
|
||||
Port4RxBroadcast FlexInt `json:"port_4-rx_broadcast"`
|
||||
|
|
|
|||
Loading…
Reference in New Issue