more fixes
This commit is contained in:
parent
9eeeaebabd
commit
dc9abc8ca8
|
|
@ -33,7 +33,6 @@ 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)
|
||||
|
||||
}
|
||||
|
||||
func (u *InfluxUnifi) processUAPstats(ap *unifi.Ap) map[string]interface{} {
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ func (u *InfluxUnifi) batchUSG(r report, s *unifi.USG) {
|
|||
"num_desktop": s.NumDesktop.Val,
|
||||
"num_handheld": s.NumHandheld.Val,
|
||||
"uplink_latency": s.Uplink.Latency.Val,
|
||||
"uplink_speed": s.Uplink.Speed.Val,
|
||||
"num_mobile": s.NumMobile.Val,
|
||||
"speedtest-status_latency": s.SpeedtestStatus.Latency.Val,
|
||||
"speedtest-status_runtime": s.SpeedtestStatus.Runtime.Val,
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ func (u *promUnifi) exportSite(r report, s *unifi.Site) {
|
|||
r.send([]*metric{
|
||||
{u.Site.TxBytesR, prometheus.GaugeValue, h.TxBytesR, labels},
|
||||
{u.Site.RxBytesR, prometheus.GaugeValue, h.RxBytesR, labels},
|
||||
{u.Site.Uptime, prometheus.GaugeValue, h.Latency, labels},
|
||||
{u.Site.Uptime, prometheus.GaugeValue, h.Uptime, labels},
|
||||
{u.Site.Latency, prometheus.GaugeValue, h.Latency.Val / 1000, labels},
|
||||
{u.Site.XputUp, prometheus.GaugeValue, h.XputUp, labels},
|
||||
{u.Site.XputDown, prometheus.GaugeValue, h.XputDown, labels},
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ func (u *promUnifi) exportUDM(r report, d *unifi.UDM) {
|
|||
u.exportUSWstats(r, labels, d.Stat.Sw)
|
||||
u.exportPortTable(r, labels, d.PortTable)
|
||||
// Gateway Data
|
||||
u.exportUSGstats(r, labels, d.Stat.Gw, d.SpeedtestStatus)
|
||||
u.exportUSGstats(r, labels, d.Stat.Gw, d.SpeedtestStatus, d.Uplink)
|
||||
u.exportWANPorts(r, labels, d.Wan1, d.Wan2)
|
||||
// Wireless Data - UDM (non-pro) only
|
||||
if d.Stat.Ap != nil && d.VapTable != nil {
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ type usg struct {
|
|||
WanTxMulticast *prometheus.Desc
|
||||
WanBytesR *prometheus.Desc
|
||||
Latency *prometheus.Desc
|
||||
UplinkLatency *prometheus.Desc
|
||||
UplinkSpeed *prometheus.Desc
|
||||
Runtime *prometheus.Desc
|
||||
XputDownload *prometheus.Desc
|
||||
XputUpload *prometheus.Desc
|
||||
|
|
@ -60,6 +62,8 @@ func descUSG(ns string) *usg {
|
|||
LanTxPackets: prometheus.NewDesc(ns+"lan_transmit_packets_total", "LAN Transmit Packets Total", labels, nil),
|
||||
LanTxBytes: prometheus.NewDesc(ns+"lan_transmit_bytes_total", "LAN Transmit Bytes Total", labels, nil),
|
||||
Latency: prometheus.NewDesc(ns+"speedtest_latency_seconds", "Speedtest Latency", labels, nil),
|
||||
UplinkLatency: prometheus.NewDesc(ns+"uplink_latency_seconds", "Uplink Latency", labels, nil),
|
||||
UplinkSpeed: prometheus.NewDesc(ns+"uplink_speed_mbps", "Uplink Speed", labels, nil),
|
||||
Runtime: prometheus.NewDesc(ns+"speedtest_runtime", "Speedtest Run Time", labels, nil),
|
||||
XputDownload: prometheus.NewDesc(ns+"speedtest_download", "Speedtest Download Rate", labels, nil),
|
||||
XputUpload: prometheus.NewDesc(ns+"speedtest_upload", "Speedtest Upload Rate", labels, nil),
|
||||
|
|
@ -90,10 +94,10 @@ func (u *promUnifi) exportUSG(r report, d *unifi.USG) {
|
|||
{u.Device.Mem, prometheus.GaugeValue, d.SystemStats.Mem, labels},
|
||||
})
|
||||
u.exportWANPorts(r, labels, d.Wan1, d.Wan2)
|
||||
u.exportUSGstats(r, labels, d.Stat.Gw, d.SpeedtestStatus)
|
||||
u.exportUSGstats(r, labels, d.Stat.Gw, d.SpeedtestStatus, d.Uplink)
|
||||
}
|
||||
|
||||
func (u *promUnifi) exportUSGstats(r report, labels []string, gw *unifi.Gw, st unifi.SpeedtestStatus) {
|
||||
func (u *promUnifi) exportUSGstats(r report, labels []string, gw *unifi.Gw, st unifi.SpeedtestStatus, ul unifi.Uplink) {
|
||||
labelLan := []string{"lan", labels[6], labels[7]}
|
||||
labelWan := []string{"all", labels[6], labels[7]}
|
||||
r.send([]*metric{
|
||||
|
|
@ -110,6 +114,8 @@ func (u *promUnifi) exportUSGstats(r report, labels []string, gw *unifi.Gw, st u
|
|||
{u.USG.LanTxPackets, prometheus.CounterValue, gw.LanTxPackets, labelLan},
|
||||
{u.USG.LanTxBytes, prometheus.CounterValue, gw.LanTxBytes, labelLan},
|
||||
{u.USG.LanRxDropped, prometheus.CounterValue, gw.LanRxDropped, labelLan},
|
||||
{u.USG.UplinkLatency, prometheus.GaugeValue, ul.Latency.Val / 1000, labelWan},
|
||||
{u.USG.UplinkSpeed, prometheus.GaugeValue, ul.Speed, labelWan},
|
||||
// Speed Test Stats
|
||||
{u.USG.Latency, prometheus.GaugeValue, st.Latency.Val / 1000, labelWan},
|
||||
{u.USG.Runtime, prometheus.GaugeValue, st.Runtime, labelWan},
|
||||
|
|
|
|||
Loading…
Reference in New Issue